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 | — | — |
Gateway sender | gfsh create gateway-sender or
cache.xml <gateway-sender> |
socket‑buffer‑size |
Gateway receiver | gfsh create gateway-receiver or cache.xml <gateway-receiver> |
socket-buffer-size |
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
cache.xml
snippets: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"/>
Note:
WAN deployments increase the messaging demands on a Geode system. To avoid hangs related to WAN messaging, always set conserve-sockets=false
for GemFire members that participate in a WAN deployment.
Multi-site (WAN) Socket Requirements
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 |
Incoming connection |
summation of the total number of remote gateway senders configured to connect to the gateway receiver |
Outgoing connection |
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.
Member produces SocketTimeoutException
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.
Response:
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.