This section describes the configuration of non-sticky sessions
Some situations require that sessions be ‘non-sticky’, which means that client requests are directed to any server in a cluster of application servers rather than returning to the same server with each request for a given client. Non-sticky sessions allow for more effective load balancing as a client operating in a model using sticky session replication will return to the same server each time regardless of load. To achieve a non-sticky session model, you must configure your deployment as described for the following modules/topologies.
Note: Non-sticky sessions affect performance because sessions need to be re-created every time a request hits a different server. This may not be noticeable when the session attributes are small, but may become more evident as the session attributes increase in size and/or number.
Peer-to-Peer
For peer-to-peer topologies, apply the following settings to enable non-sticky sessions to work correctly:
gemfire.loadClassOnEveryDeserialization=true
. Set this property by editing the bin/setenv.sh
file.prefer.deserialized.form=false
. Set this property in conf/catalina.properties
.Client-server
gemfire.loadClassOnEveryDeserialization=true
must be set, in the bin/setenv.sh
file.gemfire.cache.enable_local_cache
property is set to false. This effectively sets the local client cache to be a PROXY cache.gemfire.EXPIRE_SENDS_ENTRY_AS_CALLBACK
to true. This allows the client cache to retrieve and expire the actual session object, resulting in more consistent behavior.Peer-to-Peer
No additional configuration is required.
Client-Server
gemfire.cache.enable_local_cache
property is set to false. This effectively sets the local client cache to be a PROXY cache.gemfire.EXPIRE_SENDS_ENTRY_AS_CALLBACK
to true. This allows the client cache to retrieve and expire the actual session object, resulting in more consistent behavior.