Understanding Client Single-Hop Access to Server-Partitioned Regions
With single-hop access the client connects to every server, so more connections are generally used. This works fine for smaller installations, but is a barrier to scaling.
If you have a large installation with many clients, you may want to disable single hop by setting the pool attribute, pr-single-hop-enabled
to false in your pool declarations.
Without single hop, the client uses whatever server connection is available, the same as with all other operations. The server that receives the request determines the data location and contacts the host, which might be a different server. So more multiple-hop requests are made to the server system.
Note:
Single hop is used for the following operations: put
, get
, destroy
, invalidate
, putAll
, getAll
, removeAll
and onRegion
function execution.
Even with single hop access enabled, you will occasionally see some multiple-hop behavior. To perform single-hop data access, clients automatically get metadata from the servers about where the entry buckets are hosted. The metadata is maintained lazily. It is only updated after a single-hop operation ends up needing multiple hops, an indicator of stale metadata in the client.
Single Hop and the Pool max-connections Setting
Do not set the pool’s max-connections
setting with single hop enabled. Limiting the pool’s connections with single hop can cause connection thrashing, throughput loss, and server log bloat.
If you need to limit the pool’s connections, either disable single hop or keep a close watch on your system for these negative effects.
Setting no limit on connections, however, can result in too many connections to your servers, possibly causing you to run up against your system’s file handle limits. Review your anticipated connection use and make sure your servers are able to accommodate it.
Balancing Single-Hop Server Connection Use
Single-hop gives the biggest benefits when data access is well balanced across your servers. In particular, the loads for client/server connections can get out of balance if you have these in combination:
- Servers that are empty data accessors or that do not host the data the clients access through single-key operations
- Many single-key operations from the clients
If data access is greatly out of balance, clients can thrash trying to get to the data servers. In this case, it might be faster to disable single hop and go through servers that do not host the data.