You can fine-tune your client/server system with server load-balancing. For example, you can configure how often the servers check their load with the cache server load-poll-interval
property, or configure your own server load metrics by implementing the org.apache.geode.cache.server
package.
When the client pool requests connection information from the server locator, the locator returns the least-loaded server for the connection type. The pool uses this “best server” response to open new connections and to condition (rebalance) its existing pool connections.
load-poll-interval
. You might want to set it lower if you find your server loads fluctuating too much during normal operation. The lower you set it, however, the more overhead your load balancing will use.Tanzu GemFire provides a default utility that probes the server and its resource usage to give load information to the locators. The default probe returns the following load metrics: - The pool connection load is the number of connections to the server divided by the server’s max-connections
setting. This means that servers with a lower max-connections
setting receives fewer connections than servers with a higher setting. The load is a number between 0 and 1, where 0 means there are no connections, and 1 means the server is at max-connections
. The load estimate for each additional pool connection is 1/max-connections
. - The subscription connection load is the number of subscription queues hosted by this server. The load estimate for each additional subscription connection is 1.
To use your own server load metrics instead of the default, implement the ServerLoadProbe
or ServerLoadProbeAdapter
and related interfaces and classes in the org.apache.geode.cache.server
package. The load for each server is weighed relative to the loads reported by other servers in the system.