changeset 1367:f1e14d87d833

Updated commercial docs for the upcoming release.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 01 Dec 2014 13:40:25 +0300
parents f3b7ec81b738
children b93922e05aed
files GNUmakefile xml/en/GNUmakefile xml/en/docs/http/ngx_http_status_module.xml xml/en/docs/http/ngx_http_upstream_module.xml xml/en/docs/index.xml xml/en/docs/stream/ngx_stream_module.xml xml/en/docs/stream/ngx_stream_upstream_module.xml xml/ru/docs/http/ngx_http_status_module.xml xml/ru/docs/http/ngx_http_upstream_module.xml
diffstat 9 files changed, 741 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -223,7 +223,7 @@ rsync_gzip:
 do_gzip:	$(addsuffix .gz, $(wildcard $(ZIP)/*.html))		\
 		$(addsuffix .gz,					\
 			$(foreach lang, $(LANGS),			\
-			$(foreach dir, . docs docs/faq docs/http docs/mail, \
+			$(foreach dir, . docs docs/faq docs/http docs/mail docs/stream, \
 			$(wildcard $(ZIP)/$(lang)/$(dir)/*.html))))	\
 		$(ZIP)/index.rss.gz					\
 		$(ZIP)/LICENSE.gz					\
--- a/xml/en/GNUmakefile
+++ b/xml/en/GNUmakefile
@@ -91,6 +91,8 @@ REFS =									\
 		mail/ngx_mail_proxy_module				\
 		mail/ngx_mail_smtp_module				\
 		mail/ngx_mail_ssl_module				\
+		stream/ngx_stream_module				\
+		stream/ngx_stream_upstream_module			\
 
 TOP =									\
 		download						\
--- a/xml/en/docs/http/ngx_http_status_module.xml
+++ b/xml/en/docs/http/ngx_http_status_module.xml
@@ -154,10 +154,10 @@ Several virtual servers may share the sa
 The following status information is provided:
 <list type="tag">
 
-<tag-name><literal>version</literal></tag-name>
+<tag-name id="version"><literal>version</literal></tag-name>
 <tag-desc>
 Version of the provided data set.
-The current version is 2.
+The current version is 4.
 </tag-desc>
 
 <tag-name><literal>nginx_version</literal></tag-name>
@@ -170,7 +170,7 @@ Version of nginx.
 The address of the server that accepted status request.
 </tag-desc>
 
-<tag-name><literal>load_timestamp</literal></tag-name>
+<tag-name id="load_timestamp"><literal>load_timestamp</literal></tag-name>
 <tag-desc>
 Time of the last reload of configuration, in milliseconds since Epoch.
 </tag-desc>
@@ -224,7 +224,7 @@ The current number of client requests.
 </list>
 </tag-desc>
 
-<tag-name><literal>server_zones</literal></tag-name>
+<tag-name id="server_zones"><literal>server_zones</literal></tag-name>
 <tag-desc>
 For each <link id="status_zone"/>:
 <list type="tag">
@@ -278,7 +278,7 @@ The total number of bytes sent to client
 </list>
 </tag-desc>
 
-<tag-name><literal>upstreams</literal></tag-name>
+<tag-name id="upstreams"><literal>upstreams</literal></tag-name>
 <tag-desc>
 For each
 <link doc="ngx_http_upstream_module.xml" id="server"/>
@@ -289,27 +289,36 @@ configurable</link>
 the following data are provided:
 <list type="tag">
 
+<tag-name id="id"><literal>id</literal></tag-name>
+<tag-desc>
+The ID of the server.
+</tag-desc>
+
 <tag-name><literal>server</literal></tag-name>
 <tag-desc>
-An address of the
-<link doc="ngx_http_upstream_module.xml" id="server"/>.
+An
+<link doc="ngx_http_upstream_module.xml" id="server">address</link>
+of the server.
 </tag-desc>
 
 <tag-name><literal>backup</literal></tag-name>
 <tag-desc>
-A boolean value indicating whether the server is a backup server.
+A boolean value indicating whether the server is a
+<link doc="ngx_http_upstream_module.xml" id="backup"/>
+server.
 </tag-desc>
 
 <tag-name><literal>weight</literal></tag-name>
 <tag-desc>
-Weight of the
-<link doc="ngx_http_upstream_module.xml" id="server"/>.
+<link doc="ngx_http_upstream_module.xml" id="weight">Weight</link>
+of the server.
 </tag-desc>
 
-<tag-name><literal>state</literal></tag-name>
+<tag-name id="state"><literal>state</literal></tag-name>
 <tag-desc>
 Current state, which may be one of
 “<literal>up</literal>”,
+“<literal>draining</literal>”,
 “<literal>down</literal>”,
 “<literal>unavail</literal>”,
 or
@@ -327,6 +336,12 @@ The current number of
 idle <link doc="ngx_http_upstream_module.xml" id="keepalive"/> connections.
 </tag-desc>
 
+<tag-name id="max_conns"><literal>max_conns</literal></tag-name>
+<tag-desc>
+The <link doc="ngx_http_upstream_module.xml" id="max_conns"/> limit
+for the server.
+</tag-desc>
+
 <tag-name><literal>requests</literal></tag-name>
 <tag-desc>
 The total number of
@@ -378,8 +393,9 @@ unsuccessful attempts to communicate wit
 How many times
 the server became unavailable for client requests
 (state “<literal>unavail</literal>”)
-due to the number of unsuccessful attempts reaching
-the <literal>max_fails</literal> threshold.
+due to the number of unsuccessful attempts reaching the
+<link doc="ngx_http_upstream_module.xml" id="max_fails"/>
+threshold.
 </tag-desc>
 
 <tag-name><literal>health_checks</literal></tag-name>
@@ -429,10 +445,16 @@ when the server became
 or “<literal>unhealthy</literal>”.
 </tag-desc>
 
+<tag-name id="selected"><literal>selected</literal></tag-name>
+<tag-desc>
+The time (in milliseconds since Epoch)
+when the server was last selected to process a request (1.7.5).
+</tag-desc>
+
 </list>
 </tag-desc>
 
-<tag-name><literal>caches</literal></tag-name>
+<tag-name id="caches"><literal>caches</literal></tag-name>
 <tag-desc>
 For each cache (configured by
 <link doc="ngx_http_proxy_module.xml" id="proxy_cache_path"/> and the likes):
@@ -520,4 +542,46 @@ The total number of bytes written to the
 
 </section>
 
+<section id="compatibility" name="Compatibility">
+
+<para>
+<list type="bullet">
+
+<listitem>
+The
+<link id="selected"/> field in
+<link id="upstreams"/>
+was added in <link id="version"/> 4.
+</listitem>
+
+<listitem>
+The <link id="state">draining</link> state in
+<link id="upstreams"/>
+was added in <link id="version"/> 4.
+</listitem>
+
+<listitem>
+The
+<link id="id"/> and <link id="max_conns"/> fields in
+<link id="upstreams"/>
+were added in <link id="version"/> 3.
+</listitem>
+
+<listitem>
+The <literal>revalidated</literal> field in
+<link id="caches"/>
+was added in <link id="version"/> 3.
+</listitem>
+
+<listitem>
+The <link id="server_zones"/>, <link id="caches"/>,
+and <link id="load_timestamp"/> status data
+were added in <link id="version"/> 2.
+</listitem>
+
+</list>
+</para>
+
+</section>
+
 </module>
--- a/xml/en/docs/http/ngx_http_upstream_module.xml
+++ b/xml/en/docs/http/ngx_http_upstream_module.xml
@@ -320,7 +320,7 @@ This directive is available as part of o
 
 <para>
 Specifies a load balancing method for a server group
-where client-server mapping is based on the hashed <value>key</value> value.
+where the client-server mapping is based on the hashed <value>key</value> value.
 The <value>key</value> 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.
@@ -330,9 +330,9 @@ Perl library.
 </para>
 
 <para>
-The <literal>consistent</literal> parameter specifies that
+If the <literal>consistent</literal> parameter is specified
 the <link url="http://www.last.fm/user/RJ/journal/2007/04/10/392555/">ketama</link>
-consistent hashing method should be used instead.
+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.
@@ -1166,6 +1166,13 @@ Same as the “<literal>down</literal>” parameter
 of the <link id="server"/> directive.
 </tag-desc>
 
+<tag-name id="drain"><literal>drain=</literal></tag-name>
+<tag-desc>
+Puts the upstream server in the “draining” mode (1.7.5).
+In this mode, only requests <link id="sticky">bound</link> to the server
+will be proxied to it.
+</tag-desc>
+
 <tag-name>
 <literal>up=</literal></tag-name>
 <tag-desc>
--- a/xml/en/docs/index.xml
+++ b/xml/en/docs/index.xml
@@ -463,6 +463,22 @@ ngx_mail_smtp_module</link>
 </list>
 </para>
 
+<para>
+<list type="bullet">
+
+<listitem>
+<link doc="stream/ngx_stream_module.xml">
+ngx_stream_module</link>
+</listitem>
+
+<listitem>
+<link doc="stream/ngx_stream_upstream_module.xml">
+ngx_stream_upstream_module</link>
+</listitem>
+
+</list>
+</para>
+
 </section>
 
 </article>
new file mode 100644
--- /dev/null
+++ b/xml/en/docs/stream/ngx_stream_module.xml
@@ -0,0 +1,293 @@
+<?xml version="1.0"?>
+
+<!--
+  Copyright (C) 2014 Yaroslav Zhuravlev
+  Copyright (C) Nginx, Inc.
+  -->
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Module ngx_stream_module"
+        link="/en/docs/stream/ngx_stream_module.html"
+        lang="en"
+        rev="1">
+
+<section id="summary">
+
+<para>
+The <literal>stream</literal> module (1.7.7) provides
+proxying TCP and UNIX-domain socket connections.
+</para>
+
+<para>
+<note>
+This module is available as part of our
+<commercial_version>commercial subscription</commercial_version>.
+</note>
+</para>
+
+</section>
+
+<section id="example" name="Example Configuration">
+
+<para>
+<example>
+stream {
+    upstream backend {
+        least_conn;
+        server srv1.example.com:8000;
+        server srv2.example.com:8000;
+        server srv3.example.com:8001;
+    }
+
+    server {
+        listen 9000;
+        proxy_connect_timeout 1s;
+        proxy_timeout 3s;
+        proxy_pass backend;
+    }
+}
+</example>
+In this example, a server that listens on port 9000
+<link doc="ngx_stream_module.xml" id="proxy_pass">proxies</link>
+TCP connections to a group of servers named <literal>backend</literal>.
+Note that the <link doc="ngx_stream_module.xml" id="proxy_pass"/>
+directive defined the context of the <literal>stream</literal> module
+must not contain a protocol.
+Two optional timeout parameters are specified:
+the <link doc="ngx_stream_module.xml" id="proxy_connect_timeout"/> sets
+a timeout required for establishing a connection with a server
+that belongs to the <literal>backend</literal> group, while the
+<link doc="ngx_stream_module.xml" id="proxy_timeout"/> sets
+a timeout used after proxying to one of the servers in the
+<literal>backend</literal> group had started.
+All TCP proxy-related functionality is configured inside the
+<link doc="ngx_stream_module.xml" id="stream"/> block
+just like the <link doc="../http/ngx_http_core_module.xml" id="http"/> block
+for HTTP requests.
+</para>
+
+<para>
+The <literal>backend</literal> group consists of three physical servers
+(<literal>srv1-srv3</literal>).
+Each server name follows the obligatory <literal>port</literal> number.
+TCP connections are distributed among the servers according to the
+<link doc="ngx_stream_upstream_module.xml" id="least_conn">least
+connected</link> load balancing method: a connection will go to the server
+that has the fewest active connections.
+Directives required to configure a group of proxied servers
+and load-balancing can be found in the
+<link doc="ngx_stream_upstream_module.xml">ngx_stream_upstream_module</link>.
+</para>
+
+</section>
+
+
+<section id="directives" name="Directives">
+
+<directive name="listen">
+<syntax>
+    <value>address</value>:<value>port</value>
+    [<literal>bind</literal>]
+    [<literal>ipv6only</literal>=<literal>on</literal>|<literal>off</literal>]
+    [<literal>so_keepalive</literal>=<literal>on</literal>|<literal>off</literal>|[<value>keepidle</value>]:[<value>keepintvl</value>]:[<value>keepcnt</value>]]</syntax>
+<default/>
+<context>server</context>
+
+<para>
+Sets the <value>address</value> and <value>port</value> for the socket
+on which the server will accept connections.
+It is possible to specify just the port.
+The address can also be a hostname, for example:
+<example>
+listen 127.0.0.1:110;
+listen *:110;
+listen 110;     # same as *:110
+listen localhost:110;
+</example>
+IPv6 addresses are specified in square brackets:
+<example>
+listen [::1]:110;
+listen [::]:110;
+</example>
+UNIX-domain sockets are specified with the “<literal>unix:</literal>”
+prefix:
+<example>
+listen unix:/var/run/nginx.sock;
+</example>
+
+</para>
+
+<para>
+The directive supports the following parameters:
+
+<list type="tag">
+
+<tag-name id="bind">
+<literal>bind</literal>
+</tag-name>
+<tag-desc>
+this parameter instructs to make a separate <c-func>bind</c-func>
+call for a given address:port pair.
+The fact is that if there are several <literal>listen</literal> directives with
+the same port but different addresses, and one of the
+<literal>listen</literal> directives listens on all addresses
+for the given port (<literal>*:</literal><value>port</value>), nginx will
+<c-func>bind</c-func> only to <literal>*:</literal><value>port</value>.
+It should be noted that the <c-func>getsockname</c-func> system call will be
+made in this case to determine the address that accepted the connection.
+If the <literal>ipv6only</literal>
+or <literal>so_keepalive</literal> parameters
+are used then for a given
+<value>address</value>:<value>port</value> pair
+a separate <c-func>bind</c-func> call will always be made.
+</tag-desc>
+
+<tag-name id="ipv6only">
+<literal>ipv6only</literal>=<literal>on</literal>|<literal>off</literal>
+</tag-name>
+<tag-desc>
+this parameter determines
+(via the <c-def>IPV6_V6ONLY</c-def> socket option)
+whether an IPv6 socket listening on a wildcard address <literal>[::]</literal>
+will accept only IPv6 connections or both IPv6 and IPv4 connections.
+This parameter is turned on by default.
+It can only be set once on start.
+</tag-desc>
+
+<tag-name id="so_keepalive">
+<literal>so_keepalive</literal>=<literal>on</literal>|<literal>off</literal>|[<value>keepidle</value>]:[<value>keepintvl</value>]:[<value>keepcnt</value>]
+</tag-name>
+<tag-desc>
+this parameter configures the “TCP keepalive” behavior
+for the listening socket.
+If this parameter is omitted then the operating system’s settings will be
+in effect for the socket.
+If it is set to the value “<literal>on</literal>”, the
+<c-def>SO_KEEPALIVE</c-def> option is turned on for the socket.
+If it is set to the value “<literal>off</literal>”, the
+<c-def>SO_KEEPALIVE</c-def> option is turned off for the socket.
+Some operating systems support setting of TCP keepalive parameters on
+a per-socket basis using the <c-def>TCP_KEEPIDLE</c-def>,
+<c-def>TCP_KEEPINTVL</c-def>, and <c-def>TCP_KEEPCNT</c-def> socket options.
+On such systems (currently, Linux 2.4+, NetBSD 5+, and
+FreeBSD 9.0-STABLE), they can be configured
+using the <value>keepidle</value>, <value>keepintvl</value>, and
+<value>keepcnt</value> parameters.
+One or two parameters may be omitted, in which case the system default setting
+for the corresponding socket option will be in effect.
+For example,
+<example>so_keepalive=30m::10</example>
+will set the idle timeout (<c-def>TCP_KEEPIDLE</c-def>) to 30 minutes,
+leave the probe interval (<c-def>TCP_KEEPINTVL</c-def>) at its system default,
+and set the probes count (<c-def>TCP_KEEPCNT</c-def>) to 10 probes.
+</tag-desc>
+</list>
+</para>
+
+<para>
+Different servers must listen on different
+<value>address</value>:<value>port</value> pairs.
+</para>
+
+</directive>
+
+
+<directive name="proxy_connect_timeout">
+<syntax><value>time</value></syntax>
+<default>60s</default>
+<context>stream</context>
+<context>server</context>
+
+<para>
+Defines a timeout for establishing a connection with a proxied server.
+</para>
+
+</directive>
+
+
+<directive name="proxy_downstream_buffer">
+<syntax><value>size</value></syntax>
+<default>16k</default>
+<context>stream</context>
+<context>server</context>
+
+<para>
+Sets the <value>size</value> of the
+buffers used for reading data from the client.
+</para>
+
+</directive>
+
+
+<directive name="proxy_pass">
+<syntax><value>URL</value></syntax>
+<default/>
+<context>server</context>
+
+<para>
+Sets the address of a proxied server or a
+<link doc="ngx_stream_upstream_module.xml">server group</link>.
+The address can be specified as a domain name or IP address,
+and an obligatory port.
+If a domain name resolves to several addresses, all of them will be
+used in a round-robin fashion.
+</para>
+
+</directive>
+
+
+<directive name="proxy_timeout">
+<syntax><value>timeout</value></syntax>
+<default>10m</default>
+<context>stream</context>
+<context>server</context>
+
+<para>
+Defines a timeout used after the proxying to the backend had started.
+</para>
+
+</directive>
+
+
+<directive name="proxy_upstream_buffer">
+<syntax><value>size</value></syntax>
+<default>16k</default>
+<context>stream</context>
+<context>server</context>
+
+<para>
+Sets the <value>size</value> of the
+buffers used for reading data from the upstream server.
+</para>
+
+</directive>
+
+
+<directive name="server">
+<syntax block="yes"/>
+<default/>
+<context>stream</context>
+
+<para>
+Sets the configuration for a server.
+</para>
+
+</directive>
+
+
+<directive name="stream">
+<syntax block="yes"/>
+<default/>
+<context>main</context>
+
+<para>
+Provides the configuration file context in which the stream server directives
+are specified.
+</para>
+
+</directive>
+
+</section>
+
+</module>
new file mode 100644
--- /dev/null
+++ b/xml/en/docs/stream/ngx_stream_upstream_module.xml
@@ -0,0 +1,261 @@
+<?xml version="1.0"?>
+
+<!--
+  Copyright (C) 2014 Yaroslav Zhuravlev
+  Copyright (C) Nginx, Inc.
+  -->
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Module ngx_stream_upstream_module"
+        link="/en/docs/stream/ngx_stream_upstream_module.html"
+        lang="en"
+        rev="1">
+
+<section id="summary">
+
+<para>
+The <literal>ngx_stream_upstream_module</literal> module (1.7.7)
+is used to define groups of servers that can be referenced
+by the <link doc="ngx_stream_module.xml" id="proxy_pass"/>
+directive.
+</para>
+
+<para>
+<note>
+This module is available as part of our
+<commercial_version>commercial subscription</commercial_version>.
+</note>
+</para>
+
+</section>
+
+
+<section id="example" name="Example Configuration">
+
+<para>
+<example>
+stream {
+    upstream backend {
+        hash $remote_addr consistent;
+        server backend1.example.com:8000;
+        server backend2.example.com:8000;
+        server backend3.example.com:8001;
+    }
+
+    server {
+        listen 9000;
+        proxy_pass backend;
+    }
+}
+</example>
+</para>
+
+</section>
+
+
+<section id="directives" name="Directives">
+
+<directive name="upstream">
+<syntax block="yes"><value>name</value></syntax>
+<default/>
+<context>stream</context>
+
+<para>
+Defines a group of servers.
+Servers can listen on different ports.
+In addition, servers listening on TCP and UNIX-domain sockets
+can be mixed.
+</para>
+
+<para>
+Example:
+<example>
+upstream backend {
+    server backend1.example.com:8080 weight=5;
+    server 127.0.0.1:8080            max_fails=3 fail_timeout=30s;
+    server unix:/tmp/backend3;
+
+    server backup1.example.com:8080  backup;
+}
+</example>
+</para>
+
+<para>
+By default, connections are distributed between the servers using a
+weighted round-robin balancing method.
+In the above example, each 7 connections will be distributed as follows:
+5 connections go to <literal>backend1.example.com</literal>
+and one connection to each of the second and third servers.
+If an error occurs during communication with a server, the connection will
+be passed to the next server, and so on until all of the functioning
+servers will be tried.
+If communication with all servers fails, the connection will be closed.
+</para>
+
+</directive>
+
+
+<directive name="server">
+<syntax><value>address</value> [<value>parameters</value>]</syntax>
+<default/>
+<context>upstream</context>
+
+<para>
+Defines the <value>address</value> and other <value>parameters</value>
+of a server.
+The address can be specified as a domain name or IP address
+with an obligatory port, or as a UNIX-domain socket path
+specified after the “<literal>unix:</literal>” prefix.
+A domain name that resolves to several IP addresses defines
+multiple servers at once.
+</para>
+
+<para>
+The following parameters can be defined:
+<list type="tag">
+
+<tag-name id="weight">
+<literal>weight</literal>=<value>number</value>
+</tag-name>
+<tag-desc>
+sets the weight of the server, by default, 1.
+</tag-desc>
+
+<tag-name id="max_fails">
+<literal>max_fails</literal>=<value>number</value>
+</tag-name>
+<tag-desc>
+sets the number of unsuccessful attempts to communicate with the server
+that should happen in the duration set by the <literal>fail_timeout</literal>
+parameter to consider the server unavailable for a duration also set by the
+<literal>fail_timeout</literal> parameter.
+By default, the number of unsuccessful attempts is set to 1.
+The zero value disables the accounting of attempts.
+Here, an unsuccessful attempt is an error or timeout
+while establishing a connection with the server.
+</tag-desc>
+
+<tag-name id="fail_timeout">
+<literal>fail_timeout</literal>=<value>time</value>
+</tag-name>
+<tag-desc>
+sets
+<list type="bullet">
+
+<listitem>
+the time during which the specified number of unsuccessful attempts to
+communicate with the server should happen to consider the server unavailable;
+</listitem>
+
+<listitem>
+and the period of time the server will be considered unavailable.
+</listitem>
+
+</list>
+By default, the parameter is set to 10 seconds.
+</tag-desc>
+
+<tag-name id="backup">
+<literal>backup</literal>
+</tag-name>
+<tag-desc>
+marks the server as a backup server.
+Connections to the backup server will be passed
+when the primary servers are unavailable.
+</tag-desc>
+
+<tag-name id="down">
+<literal>down</literal>
+</tag-name>
+<tag-desc>
+marks the server as permanently unavailable; used along with
+the <link id="hash"/> directive.
+</tag-desc>
+
+<tag-name id="max_conns">
+<literal>max_conns</literal>=<value>number</value>
+</tag-name>
+<tag-desc>
+limits the maximum <value>number</value> of simultaneous connections to the
+proxied server.
+Default value is zero, meaning there is no limit.
+</tag-desc>
+
+<tag-name id="slow_start">
+<literal>slow_start</literal>=<value>time</value>
+</tag-name>
+<tag-desc>
+sets the <value>time</value> during which the server will recover its weight
+from zero to a nominal value,
+or when the server becomes available after a period of time
+it was considered <link id="fail_timeout">unavailable</link>.
+Default value is zero, i.e. slow start is disabled.
+</tag-desc>
+
+</list>
+</para>
+
+<para>
+<note>
+If there is only a single server in a group, <literal>max_fails</literal>,
+<literal>fail_timeout</literal> and <literal>slow_start</literal> parameters
+are ignored, and such a server will never be considered unavailable.
+</note>
+</para>
+
+</directive>
+
+
+<directive name="hash">
+<syntax><value>key</value> [<literal>consistent</literal>]</syntax>
+<default/>
+<context>upstream</context>
+
+<para>
+Specifies a load balancing method for a server group
+where client-server mapping is based on the hashed <value>key</value> value.
+Currently, the only supported value for the <literal>key</literal>
+is the client remote address specified as <literal>$remote_addr</literal>.
+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
+<link url="http://search.cpan.org/perldoc?Cache%3A%3AMemcached">Cache::Memcached</link>
+Perl library.
+</para>
+
+<para>
+If the <literal>consistent</literal> parameter is specified,
+the <link url="http://www.last.fm/user/RJ/journal/2007/04/10/392555/">ketama</link>
+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
+<link url="http://search.cpan.org/perldoc?Cache%3A%3AMemcached%3A%3AFast">Cache::Memcached::Fast</link>
+Perl library with the <value>ketama_points</value> parameter set to 160.
+</para>
+
+</directive>
+
+
+<directive name="least_conn">
+<syntax/>
+<default/>
+<context>upstream</context>
+
+<para>
+Specifies that a server group should use a load balancing method
+where a connection
+is passed to the server with the least number of active connections,
+taking into account weights of servers.
+If there are several such servers, they are tried in turn using a
+weighted round-robin balancing method.
+</para>
+
+</directive>
+
+</section>
+
+</module>
--- a/xml/ru/docs/http/ngx_http_status_module.xml
+++ b/xml/ru/docs/http/ngx_http_status_module.xml
@@ -157,10 +157,10 @@ http://127.0.0.1/status/upstreams/backen
 Доступна следующая информация:
 <list type="tag">
 
-<tag-name><literal>version</literal></tag-name>
+<tag-name id="version"><literal>version</literal></tag-name>
 <tag-desc>
 Версия предоставляемого набора данных.
-Текущей является версия 2.
+Текущей является версия 4.
 </tag-desc>
 
 <tag-name><literal>nginx_version</literal></tag-name>
@@ -173,7 +173,7 @@ http://127.0.0.1/status/upstreams/backen
 Адрес сервера, принявшего запрос получения информации о состоянии.
 </tag-desc>
 
-<tag-name><literal>load_timestamp</literal></tag-name>
+<tag-name id="load_timestamp"><literal>load_timestamp</literal></tag-name>
 <tag-desc>
 Время последней перезагрузки конфигурации, в миллисекундах с начала эпохи.
 </tag-desc>
@@ -227,7 +227,7 @@ http://127.0.0.1/status/upstreams/backen
 </list>
 </tag-desc>
 
-<tag-name><literal>server_zones</literal></tag-name>
+<tag-name id="server_zones"><literal>server_zones</literal></tag-name>
 <tag-desc>
 Для каждой <link id="status_zone"/>:
 <list type="tag">
@@ -281,7 +281,7 @@ http://127.0.0.1/status/upstreams/backen
 </list>
 </tag-desc>
 
-<tag-name><literal>upstreams</literal></tag-name>
+<tag-name id="upstreams"><literal>upstreams</literal></tag-name>
 <tag-desc>
 Для каждого
 <link doc="ngx_http_upstream_module.xml" id="server">сервера</link>
@@ -292,27 +292,34 @@ http://127.0.0.1/status/upstreams/backen
 доступны следующие данные:
 <list type="tag">
 
+<tag-name id="id"><literal>id</literal></tag-name>
+<tag-desc>
+Идентификатор сервера.
+</tag-desc>
+
 <tag-name><literal>server</literal></tag-name>
 <tag-desc>
-Адрес
-<link doc="ngx_http_upstream_module.xml" id="server">сервера</link>.
+<link doc="ngx_http_upstream_module.xml" id="server">Адрес</link>
+сервера.
 </tag-desc>
 
 <tag-name><literal>backup</literal></tag-name>
 <tag-desc>
-Логическое значение, означающее, является ли сервер запасным.
+Логическое значение, означающее, является ли сервер
+<link doc="ngx_http_upstream_module.xml" id="backup">запасным</link>.
 </tag-desc>
 
 <tag-name><literal>weight</literal></tag-name>
 <tag-desc>
-Вес
-<link doc="ngx_http_upstream_module.xml" id="server">сервера</link>.
+<link doc="ngx_http_upstream_module.xml" id="weight">Вес</link>
+сервера.
 </tag-desc>
 
-<tag-name><literal>state</literal></tag-name>
+<tag-name id="state"><literal>state</literal></tag-name>
 <tag-desc>
 Текущее состояние, которое может быть одним из
 “<literal>up</literal>”,
+“<literal>draining</literal>”,
 “<literal>down</literal>”,
 “<literal>unavail</literal>”
 или
@@ -330,6 +337,12 @@ http://127.0.0.1/status/upstreams/backen
 <link doc="ngx_http_upstream_module.xml" id="keepalive"/>-соединений.
 </tag-desc>
 
+<tag-name id="max_conns"><literal>max_conns</literal></tag-name>
+<tag-desc>
+Ограничение <link doc="ngx_http_upstream_module.xml" id="max_conns"/>
+для сервера.
+</tag-desc>
+
 <tag-name><literal>requests</literal></tag-name>
 <tag-desc>
 Суммарное число
@@ -381,8 +394,8 @@ http://127.0.0.1/status/upstreams/backen
 Количество раз, когда
 сервер становился недоступным для клиентских запросов
 (состояние “<literal>unavail</literal>”)
-из-за достижения порогового числа неудачных
-попыток <literal>max_fails</literal>.
+из-за достижения порогового числа неудачных попыток
+<link doc="ngx_http_upstream_module.xml" id="max_fails"/>.
 </tag-desc>
 
 <tag-name><literal>health_checks</literal></tag-name>
@@ -432,10 +445,16 @@ http://127.0.0.1/status/upstreams/backen
 или “<literal>unhealthy</literal>”.
 </tag-desc>
 
+<tag-name id="selected"><literal>selected</literal></tag-name>
+<tag-desc>
+Время (в миллисекундах с начала эпохи),
+когда сервер в последний раз был выбран для обработки запроса (1.7.5).
+</tag-desc>
+
 </list>
 </tag-desc>
 
-<tag-name><literal>caches</literal></tag-name>
+<tag-name id="caches"><literal>caches</literal></tag-name>
 <tag-desc>
 Для каждого кэша, сконфигурированного при помощи
 <link doc="ngx_http_proxy_module.xml" id="proxy_cache_path"/>
@@ -526,4 +545,43 @@ http://127.0.0.1/status/upstreams/backen
 
 </section>
 
+<section id="compatibility" name="Совместимость">
+
+<para>
+<list type="bullet">
+
+<listitem>
+Поле <link id="selected"/> в
+<link id="upstreams"/>
+было добавлено в <link id="version">версии</link> 4.
+</listitem>
+
+<listitem>
+Состояние <link id="state">draining</link> в
+<link id="upstreams"/>
+было добавлено в <link id="version">версии</link> 4.
+</listitem>
+
+<listitem>
+Поля <link id="id"/> и <link id="max_conns"/> в
+<link id="upstreams"/>
+были добавлены в <link id="version">версии</link> 3.
+</listitem>
+
+<listitem>
+Поле <literal>revalidated</literal> в <link id="caches"/>
+было добавлено в <link id="version">версии</link> 3.
+</listitem>
+
+<listitem>
+<link id="server_zones"/>, <link id="caches"/>
+и <link id="load_timestamp"/>
+были добавлены в <link id="version">версии</link> 2.
+</listitem>
+
+</list>
+</para>
+
+</section>
+
 </module>
--- a/xml/ru/docs/http/ngx_http_upstream_module.xml
+++ b/xml/ru/docs/http/ngx_http_upstream_module.xml
@@ -1173,6 +1173,14 @@ http://127.0.0.1/upstream_conf?upstream=
 директивы <link id="server"/>.
 </tag-desc>
 
+<tag-name id="drain"><literal>drain=</literal></tag-name>
+
+<tag-desc>
+Переводит сервер группы в режим “draining” (1.7.5).
+В этом режиме на сервер будут проксироваться только
+<link id="sticky">привязанные</link> к нему запросы.
+</tag-desc>
+
 <tag-name>
 <literal>up=</literal></tag-name>
 <tag-desc>