TCP_NIO
TCP_NIO is fully functional implementation of tcp non blocking I/O. However, for production deployments we still recommend plain TCP transport.
Common Configuration Parameters (shared with JGroupsTCP)
{font:courier new
{font:courier new{font:courier newstart_port="7800"} The port to create the server socket on. If the specified port is not available, the TCP protocol increments it in a loop until if finds an available port. If not specified, the default value is 7800. If set to 0, then the operating system will pick a port. This will work only if we use MPING or TCPGOSSIP as discovery protocol because TCPPING requires listing the nodes and their corresponding ports!
{font:courier new
{font:courier new{font:courier newend_port} The largest port number to attempt to create the server socket on. The server will try to bind to a port in the range start_port -> end_port. If no port in the given range is available, a BindException is thrown. If no end_port is provided or end_port < start_port then there is no upper limit on the port range. If start_port == end_port, then we force JGroups to use the given port (start fails if port is not available)
{font:courier new
{font:courier new{font:courier newbind_addr="192.168.1.3"} The interface to create the server socket on. Useful in case of a multihomed machine. If not specified, the server socket will be created on all available interfaces.
{font:courier new
{font:courier new{font:courier newloopback=true} Loops back messages to self if true. By default is false.
{font:courier new
{font:courier new{font:courier newreaper_interval} Time, in milliseconds, between successive runs of the reaper thread. The reaper thread checks whether a connection was idle for more than conn_expire_time and if true, closes the connection. By default, reaper_interval is 0, which means no reaper.
{font:courier new
{font:courier new{font:courier newconn_expire_time} Maximum time in milliseconds a connection can be idle before being reaped.
{font:courier new
{font:courier new{font:courier newsock_conn_timeout} When doing the initial discovery, and a peer hangs, don't wait forever but go on after the timeout to ping other members. Reduces chances of not finding any members at all.
{font:courier new
{font:courier new{font:courier newuse_send_queues} When sending a message, place it into a queue and have a separate thread send it. Prevents blocking on write if the peer hangs.
{font:courier new
{font:courier new{font:courier newexternal_addr} External IP address to broadcast to other group members (if different to local address). This is useful when you have use (Network Address Translation) NAT, e.g. a node on a private network, behind a firewall, but you can only route to it via an externally visible address, which is different from the local address it is bound to. Therefore, the node can be configured to broadcast its external address, while still able to bind to the local one. This avoids having to use the TUNNEL protocol, (and hence a requirement for a central gossip router) because nodes outside the firewall can still route to the node inside the firewall, but only on its external address. Without setting the external_addr, the node behind the firewall will broadcast its private address to the other nodes which will not be able to route to it.
TCP_NIO Configuration Parameters
{font:courier new
{font:courier new{font:courier newreader_threads=3} The number of threads that will handle reading of socket connections.
{font:courier new
{font:courier new{font:courier newwriter_threads=3} The number of threads that will handle writing to socket connections.
{font:courier new
{font:courier new{font:courier newprocessor_threads=5} The initial number of threads that will process received requests.
{font:courier new
{font:courier new{font:courier newprocessor_minThreads=5} The min number of threads that will process received requests.
{font:courier new
{font:courier new{font:courier newprocessor_maxThreads=5} The max number of threads that will process received requests.
{font:courier new
{font:courier new{font:courier newprocessor_queueSize=100} The max number of queued received requests that are waiting to be run in a "processor" thread.
{font:courier new
{font:courier new{font:courier newprocessor_keepAliveTime=Long.MAX_VALUE} How long before idle "processor" threads are stopped.
Sample Config:
<config>
<!VERIFY_SUSPECT timeout="1500" down_thread="false"/>
</config>
Internals + Performance
A description of the TCP_NIO internals + performance is available here. Other performance information is available from here.
Comments