# HG changeset patch # User Yaroslav Zhuravlev # Date 1403010337 -14400 # Node ID 6cc8098816943314b8ada57d53d20daa3759df1b # Parent 7dd620e507c3070446414c07a7f707416dd75ff0 Upstream: added the "hash" directive. diff -r 7dd620e507c3 -r 6cc809881694 xml/en/docs/http/ngx_http_upstream_module.xml --- a/xml/en/docs/http/ngx_http_upstream_module.xml Tue Jun 17 17:22:10 2014 +0400 +++ b/xml/en/docs/http/ngx_http_upstream_module.xml Tue Jun 17 17:05:37 2014 +0400 @@ -10,7 +10,7 @@ + rev="24">
@@ -298,6 +298,39 @@ + +key [consistent] + +upstream +1.7.2 + + +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. +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. + + + +The consistent parameter specifies that +the ketama +consistent hashing method should 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 is set to 160. + + + + + diff -r 7dd620e507c3 -r 6cc809881694 xml/ru/docs/http/ngx_http_upstream_module.xml --- a/xml/ru/docs/http/ngx_http_upstream_module.xml Tue Jun 17 17:22:10 2014 +0400 +++ b/xml/ru/docs/http/ngx_http_upstream_module.xml Tue Jun 17 17:05:37 2014 +0400 @@ -243,6 +243,40 @@ + +ключ [consistent] + +upstream +1.7.2 + + +Задаёт метод балансировки нагрузки для группы, при котором +соответствие клиента серверу определяется при помощи +хэшированного значения ключа. +В качестве ключа может использоваться +текст, переменные и их комбинации. +Следует отметить, что любое добавление или удаление серверов в группе +может привести к перераспределению большинства ключей на другие серверы. +Метод совместим с библиотекой Perl +Cache::Memcached. + + + +Если задан параметр consistent, то вместо +вышеописанного метода будет использоваться метод консистентного хэширования +ketama. +Метод гарантирует, что при добавлении сервера в группу или его удалении +на другие серверы будет перераспределено минимальное число ключей. +Применение метода для кэширующих серверов обеспечивает +больший процент попаданий в кэш. +Метод совместим с библиотекой Perl +Cache::Memcached::Fast +при значении параметра ketama_points равным 160. + + + + +