Syntax: | hash |
---|---|
Default: | — |
Context: | upstream |
Specifies a load balancing method for a server group where client-server mapping is based on the hashed key
value. The key
can contain text, variables, and their combinations (1.11.2). Usage example:
hash $remote_addr;
Note that adding or removing a server from the group may result in remapping most of the keys to different servers. The method is compatible with the Cache::Memcached Perl library.
If the consistent
parameter is specified, the ketama consistent hashing method will be used instead. The method ensures that only a few keys will be remapped to different servers when a server is added to or removed from the group. This helps to achieve a higher cache hit ratio for caching servers. The method is compatible with the Cache::Memcached::Fast Perl library with the ketama_points
parameter set to 160.
Please login to continue.