- One of the most important performance considerations is the synchronous (pooled or not pooled) versus asynchronous replication
+ One of the most important performance considerations is the synchronous versus asynchronous replication
mode. In a synchronous replication mode the request doesn't return until the replicated session has been
sent over the wire and reinstantiated on all the other cluster nodes.
There are two settings for synchronous replication. Pooled or not pooled.
@@ -333,659 +364,6 @@ are for the actual TCP replication.
During async replication, the request is returned before the data has been replicated. async replication yields shorter
request times, and synchronous replication guarantees the session to be replicated before the request returns.
-
- The parameter "replicationMode" has four different settings: "pooled", "synchronous", "asynchronous" and "fastasyncqueue"
-
Open Membership receiver at 228.0.0.4 and send to multicast udp port 8012
-
Send membership every 1 sec and drop member after 30sec.
-
Open message receiver at default ip interface at first free port between 8015 and 8019.
-
Receiver message with SocketReplicationListener
-
Configure a ReplicationTransmitter with fastasyncqueue sender mode.
-
Add ClusterSessionListener and ReplicationValve.
-
-
-
-NOTE: Use this configuration when you need very quick a test cluster with
-at your developer machine. You can change the default attributes from cluster sub elements.
-Use following cluster attribute prefixes sender.,
-receiver., service., manager., valve. and listener..
- Example configure cluster at windows laptop with network connection and
-change receiver port range
-
-<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
- service.mcastBindAddress="127.0.0.1"
- receiver.tcpListenPort="9070"
- receiver.tcpListenMaxPort="9075" />
-
-
-WARNING: When you add you sub elements, there overwrite the defaults complete.
- Example configure cluster with cluster failover jsessionid support. In this
-case you need also the defaultmode Cluster listener ClusterSessionListener and ReplicationValve.
-
-<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
- service.mcastBindAddress="127.0.0.1"
- receiver.tcpListenPort="9070"
- receiver.tcpListenMaxPort="9075" >
- <ClusterListener className="org.apache.catalina.cluster.session.ClusterSessionListener" />
- <ClusterListener className="org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener" />
- <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
- filter=".*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"
- primaryIndicator="true" />
- <Valve className="org.apache.catalina.cluster.session.JvmRouteBinderValve"
- enabled="true" />
-<Cluster/>
-
-
replication mode (synchronous, pooled, asynchronous or fastasyncqueue)
-
-
pooled
-
-
-
-
processSenderFrequency
-
Control the sender keepalive status and drop sender socket connection after timeout is reached.
- Check every processSenderFrequency value engine background ticks.
-
-
2
-
-
-
-
compress
-
compress bytes before sending (consume memory, but reduce network traffic - GZIP)
-
false
-
-
-
-
ackTimeout
-
acknowledge timeout and only usefull it waitForAck is true
-
15000
-
-
-
-
waitForAck
-
Wait for ack after data send
-
false
-
-
-
-
autoConnect
-
is sender disabled, fork a new socket
-
false
-
-
-
-
doTransmitterProcessingStats
-
create processing time stats
-
false
-
-
-
-
-Example to get statistic information, wait for ack at every message send and transfer at compressed mode
-
- <Sender
- className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
- replicationMode="fastasyncqueue"
- compress="true"
- doTransmitterProcessingStats="true"
- ackTimeout="15000"
- waitForAck="true"
- autoConnect="false"/>
-
-
-
-
-
-
-List of Attributes
-
-
-
-
Attribute
-
Description
-
Default value
-
-
-
-
keepAliveTimeout
-
active socket keep alive timeout
-
60000
-
-
-
-
keepAliveMaxRequestCount
-
max request over this socket
-
-1
-
-
-
-
doProcessingStats
-
create Processing time stats
-
false
-
-
-
-
doWaitAckStats
-
create waitAck time stats
-
false
-
-
-
-
resend
-
resend message after failure, can overwrite at message
-
false
-
-
-
-
queueDoStats
-
activated queue stats
-
false
-
-
-
-
queueCheckLock
-
check to lost locks
-
false
-
-
-
queueAddWaitTimeout
-
queue add wait time (tomcat connector thread waits)
-
10000
-
-
-
queueRemoveWaitTimeout
-
queue remove wait time (queue thread waits)
-
30000
-
-
-
-
maxQueueLength
-
max queue length (default without limit)
-
-1
-
-
-
-
threadPriority
-
change queue thread priority (1-10 ; 5 is normal)
-
5
-
-
-
-
-
-Example to get a lot of statistic information and no wait for ACK
-
- <Sender
- className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
- replicationMode="fastasyncqueue"
- doTransmitterProcessingStats="true"
- doProcessingStats="true"
- queueTimeWait="true"
- queueDoStats="true"
- queueCheckLock="true"
- waitForAck="false"
- autoConnect="false"
- keepAliveTimeout="320000"
- keepAliveMaxRequestCount="-1"/>
-
-
-
-
-
-
-List of Attributes
-
-
-
-
Attribute
-
Description
-
Default value
-
-
-
-
keepAliveTimeout
-
active socket keep alive timeout
-
60000
-
-
-
-
keepAliveMaxRequestCount
-
max request over this socket
-
-1
-
-
-
-
doProcessingStats
-
create Processing time stats
-
false
-
-
-
-
doWaitAckStats
-
create waitAck time stats
-
false
-
-
-
-
resend
-
resend message after failure, can overwrite at message
-
false
-
-
-
-
-
-Example to get a processing statistic information, resend after failure and wait for ACK
-
- <Sender
- className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
- replicationMode="asynchronous"
- doProcessingStats="true"
- doWaitAckStats="true"
- waitForAck="true"
- ackTimeout="30000"
- resend="true"
- keepAliveTimeout="320000"
- keepAliveMaxRequestCount="-1"/>
-
-
-
-
-
-
-List of Attributes
-
-
-
-
Attribute
-
Description
-
Default value
-
-
-
-
keepAliveTimeout
-
active socket keep alive timeout
-
60000
-
-
-
-
keepAliveMaxRequestCount
-
max request over this socket
-
-1
-
-
-
-
doProcessingStats
-
create Processing time stats
-
false
-
-
-
-
doWaitAckStats
-
create waitAck time stats
-
true
-
-
-
-
resend
-
resend message after failure, can overwrite at message
-
false
-
-
-
-
-
-
-Example to get a no processing statistic information, no wait for ACK, after 10000 request renew socket and autoconnect before first request is send.
-
- <Sender
- className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
- replicationMode="synchronous"
- autoConnect="true"
- keepAliveTimeout="-1"
- keepAliveMaxRequestCount="100000"/>
-
-
-
-
-
-
-List of Attributes
-
-
-
-
Attribute
-
Description
-
Default value
-
-
-
-
keepAliveTimeout
-
active socket keep alive timeout
-
60000
-
-
-
-
keepAliveMaxRequestCount
-
max request over this socket
-
-1
-
-
-
-
maxPoolSocketLimit
-
max pooled sockets (Sender Sockets)
-
25
-
-
-
-
resend
-
resend message after failure, can overwrite at message
-
false
-
-
-
-
-
-
-Example to get a no processing statistic information, wait for ACK, after 10000 request renew socket, only 10 SockerSender available and autoconnect before first request is send.
-
- <Sender
- className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
- replicationMode="pooled"
- autoConnect="true"
- maxPoolSocketLimit="10"
- keepAliveTimeout="-1"
- keepAliveMaxRequestCount="10000"
- waitForAck="true" />
-
-
-
-
-
-
-List of Attributes
-
-
-
-
Attribute
-
Description
-
Default value
-
-
-
-
expireSessionsOnShutdown
-
When server stopped, expire all sessions also at backup nodes (only for testing)
-
false
-
-
-
-
maxActiveSessions
-
Number of active sessions. (Default is no limit)
-
-1
-
-
-
-
notifyListenersOnReplication
-
Notify application session listener to session creation
- and expiring events at backup nodes
-
true
-
-
-
-
notifySessionListenersOnReplication
-
Notify application session listener to attribute changes at backup nodes
-
true
-
-
-
-
stateTransferTimeout
-
Timeout that session state transfer is complete. Is attribute stateTransferTimeout == -1
- then application wait that other node send the complete session state
-
60
-
-
-
-
sendAllSessions
-
Flag to send sessions as splited blocks
-
true
-
-
-
-
sendAllSessionsSize
-
Number of serialize sessions inside a send block session message. Only useful when sendAllSessions==false
-
1000
-
-
-
-
sendAllSessionsWaitTime
-
wait time between two session send blocks.
-
2000
-
-
-
-
sendClusterDomainOnly
-
Send all session messages only to member inside same cluster domain
- (value od Membership attribute mcastClusterDomain). Also don't handle
- session messages from other domains.
-
true
-
-
-
-
stateTimestampDrop
-
DeltaManager queued Sessions messages when send GET_ALL_SESSION to other node.
- with stateTimestampDrop all messages before state transfer message creation date (find session) are dropped.
- Only other GET_ALL_SESSION events are handle with date before state transfer message.
-
true
-
-
-
-
-
-
-Example send all sessions at separate blocks. Serialize and send 100 session inside one block.
-Wait maximale two minutes before the complete backup sessions are loaded inside tomcat boot process.
-Between send blocks wait 5 secs to transfers the session block to other node. This save memory
-when you use the async modes with queues.
-
- <Cluster className="org.apache.catalina.tcp.SimpleTcpCluster"
- managerClassName="org.apache.catalina.cluster.session.DeltaManager"
- manager.stateTransferTimeout="120"
- manager.sendAllSessions="false"
- manager.sendAllSessionsSize="100"
- manager.sendAllSessionsWaitTime="5000"
- "/>
-
-
-
-Note:
-As Cluster.defaultMode=true you can configure the manager attributes with prefix manager..
-
-Note:
-With Cluster.setProperty(<String>,<String>) you can modify
-attributes for all register managers. The method exists as MBeans operation.
-