# HG changeset patch # User Ruslan Ermilov # Date 1327615975 0 # Node ID c7fccbe0382793b555062f247df4cbcb9a44fd5b # Parent db6774c4c699f859b780e6813c94be89816a6c48 English translation of ngx_http_memcached_module. diff -r db6774c4c699 -r c7fccbe03827 xml/en/GNUmakefile --- a/xml/en/GNUmakefile Thu Jan 26 22:11:16 2012 +0000 +++ b/xml/en/GNUmakefile Thu Jan 26 22:12:55 2012 +0000 @@ -63,6 +63,7 @@ http/ngx_http_limit_req_module \ http/ngx_http_log_module \ http/ngx_http_map_module \ + http/ngx_http_memcached_module \ http/ngx_http_mp4_module \ http/ngx_http_proxy_module \ http/ngx_http_random_index_module \ diff -r db6774c4c699 -r c7fccbe03827 xml/en/docs/http/ngx_http_memcached_module.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/en/docs/http/ngx_http_memcached_module.xml Thu Jan 26 22:12:55 2012 +0000 @@ -0,0 +1,185 @@ + + + + + + +
+ + +The ngx_http_memcached_module module allows to obtain +responses from a memcached server. +The key is set in the $memcached_key variable. +A response should be put in memcached in advance via means that are +external to nginx. + + +
+ + +
+ + + +server { + location / { + set $memcached_key "$uri?$args"; + memcached_pass host:11211; + error_page 404 502 504 = @fallback; + } + + location @fallback { + proxy_pass http://backend; + } +} + + + +
+ + +
+ + +size +4k|8k +http +server +location + + +Sets size of the buffer used for reading a response +received from the memcached server. +A response is passed to a client synchronously, immediately as it is received. + + + + + + +time +60s +http +server +location + + +Defines a timeout for establishing a connection with the memcached server. +It should be noted that this timeout cannot usually exceed 75 seconds. + + + + + + + + error | + timeout | + invalid_response | + not_found | + off + ... +error timeout +http +server +location + + +Specifies in which cases a request should be passed to the next server: + + +error +an error occurred while establishing a connection with the +server, passing it a request, or reading the response header; + +timeout +a timeout has occurred while establishing a connection with the +server, passing it a request, or reading the response header; + +invalid_response +a server returned empty or invalid response; + +not_found +a response was not found on the server; + +off +disables passing a request to the next server. + + + + + +It should be understood that passing a request to the next server is +only possible if a client was not sent anything yet. +That is, if an error or a timeout occurs in the middle of +transferring a response, fixing this is impossible. + + + + + + +address + +location +if in location + + +Sets an address of the memcached server. +An address can be specified as a domain name or an address, and a port, +for example, + +memcached_pass localhost:11211; + + + + +If a domain name resolves to several addresses, all of them will be +used in a round-robin fashion. +In addition, an address can be specified as a +server group. + + + + + + +time +60s +http +server +location + + +Defines a timeout for reading a response from the memcached server. +A timeout is only set between two successive read operations, +not for the transmission of the whole response. +If a memcached server does not transmit anything within this time, +a connection is closed. + + + + + + +time +60s +http +server +location + + +Sets a timeout for transmitting a request to the memcached server. +A timeout is only set between two successive write operations, +not for the transmission of the whole request. +If a memcached server does not receive anything within this time, +a connection is closed. + + + + +
+ +
diff -r db6774c4c699 -r c7fccbe03827 xml/en/docs/index.xml --- a/xml/en/docs/index.xml Thu Jan 26 22:11:16 2012 +0000 +++ b/xml/en/docs/index.xml Thu Jan 26 22:12:55 2012 +0000 @@ -165,6 +165,11 @@ + +ngx_http_memcached_module + + + ngx_http_mp4_module diff -r db6774c4c699 -r c7fccbe03827 xml/en/index.xml --- a/xml/en/index.xml Thu Jan 26 22:11:16 2012 +0000 +++ b/xml/en/index.xml Thu Jan 26 22:12:55 2012 +0000 @@ -56,7 +56,9 @@ Accelerated support with caching of FastCGI, -uwsgi, SCGI, and memcached servers; +uwsgi, SCGI, and +memcached +servers; simple load balancing and fault tolerance;