Configuring Sockets in Multi-Site (WAN) Deployments
When you determine buffer size settings, you try to strike a balance between communication needs and other processing.
This table lists the settings for gateway relationships and protocols, and tells where to set them.
|Protocol / Area Affected||Configuration Location||Property Name|
|TCP / IP||—||—|
TCP/IP Buffer Sizes
If possible, your TCP/IP buffer size settings should match across your installation. At a minimum, follow the guidelines listed here.
Multisite (WAN). In a multi-site installation using gateways, if the link between sites is not tuned for optimum throughput, it could cause messages to back up in the cache queues. If a receiving queue overflows because of inadequate buffer sizes, it will become out of sync with the sender and the receiver will be unaware of the condition.
The gateway sender’s socket-buffer-size attribute should match the gateway receiver’s socket-buffer-size attribute for all gateway receivers that the sender connects to, as in these example
Gateway Sender Socket Buffer Size cache.xml Configuration: <gateway-sender id="sender2" parallel="true" remote-distributed-system-id="2" socket-buffer-size="42000" maximum-queue-memory="150"/> Gateway Receiver Socket Buffer Size cache.xml Configuration: <gateway-receiver start-port="1530" end-port="1551" socket-buffer-size="42000"/>
WAN deployments increase the messaging demands on a GemFire system. To avoid hangs related to WAN messaging, always set
conserve-sockets=false for GemFire members that participate in a WAN deployment.
Each gateway sender and gateway receiver uses a socket to distribute events or to listen for incoming connections from remote sites.
|Multi-site Socket Description||Number Used|
Listener for incoming connections
summation of the number of gateway-receivers defined for the member
summation of the total number of remote gateway senders configured to connect to the gateway receiver
summation of the number of gateway senders defined for the member
Servers are peers in their own clusters and have the additional socket requirements as noted in the Peer-to-Peer section above.
A client, server, gateway sender, or gateway receiver produces a
SocketTimeoutException when it stops waiting for a response from the other side of the connection and closes the socket. This exception typically happens on the handshake or when establishing a callback connection.
Increase the default socket timeout setting for the member. This timeout is set separately for the client Pool and for the gateway sender and gateway receiver, either in the
cache.xml file or through the API. For a client/server configuration, adjust the “read-timeout” value as described in <pool> or use the
org.apache.geode.cache.client.PoolFactory.setReadTimeout method. For a gateway sender or gateway receiver, see WAN Configuration.