comparison xml/en/docs/http/ngx_http_memcached_module.xml @ 363:c7fccbe03827

English translation of ngx_http_memcached_module.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 26 Jan 2012 22:12:55 +0000
parents
children bb51d3e17dd0
comparison
equal deleted inserted replaced
362:db6774c4c699 363:c7fccbe03827
1 <?xml version="1.0"?>
2
3 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
4
5 <module name="Module ngx_http_memcached_module"
6 link="/en/docs/http/ngx_http_memcached_module.html"
7 lang="en">
8
9 <section id="summary">
10
11 <para>
12 The <literal>ngx_http_memcached_module</literal> module allows to obtain
13 responses from a memcached server.
14 The key is set in the <var>$memcached_key</var> variable.
15 A response should be put in memcached in advance via means that are
16 external to nginx.
17 </para>
18
19 </section>
20
21
22 <section id="example" name="Example Configuration">
23
24 <para>
25 <example>
26 server {
27 location / {
28 set $memcached_key "$uri?$args";
29 memcached_pass host:11211;
30 error_page 404 502 504 = @fallback;
31 }
32
33 location @fallback {
34 proxy_pass http://backend;
35 }
36 }
37 </example>
38 </para>
39
40 </section>
41
42
43 <section id="directives" name="Directives">
44
45 <directive name="memcached_buffer_size">
46 <syntax><value>size</value></syntax>
47 <default>4k|8k</default>
48 <context>http</context>
49 <context>server</context>
50 <context>location</context>
51
52 <para>
53 Sets <value>size</value> of the buffer used for reading a response
54 received from the memcached server.
55 A response is passed to a client synchronously, immediately as it is received.
56 </para>
57
58 </directive>
59
60
61 <directive name="memcached_connect_timeout">
62 <syntax><value>time</value></syntax>
63 <default>60s</default>
64 <context>http</context>
65 <context>server</context>
66 <context>location</context>
67
68 <para>
69 Defines a timeout for establishing a connection with the memcached server.
70 It should be noted that this timeout cannot usually exceed 75 seconds.
71 </para>
72
73 </directive>
74
75
76 <directive name="memcached_next_upstream">
77 <syntax>
78 <literal>error</literal> |
79 <literal>timeout</literal> |
80 <literal>invalid_response</literal> |
81 <literal>not_found</literal> |
82 <literal>off</literal>
83 ...</syntax>
84 <default>error timeout</default>
85 <context>http</context>
86 <context>server</context>
87 <context>location</context>
88
89 <para>
90 Specifies in which cases a request should be passed to the next server:
91 <list type="tag">
92
93 <tag-name><literal>error</literal></tag-name>
94 <tag-desc>an error occurred while establishing a connection with the
95 server, passing it a request, or reading the response header;</tag-desc>
96
97 <tag-name><literal>timeout</literal></tag-name>
98 <tag-desc>a timeout has occurred while establishing a connection with the
99 server, passing it a request, or reading the response header;</tag-desc>
100
101 <tag-name><literal>invalid_response</literal></tag-name>
102 <tag-desc>a server returned empty or invalid response;</tag-desc>
103
104 <tag-name><literal>not_found</literal></tag-name>
105 <tag-desc>a response was not found on the server;</tag-desc>
106
107 <tag-name><literal>off</literal></tag-name>
108 <tag-desc>disables passing a request to the next server.</tag-desc>
109
110 </list>
111 </para>
112
113 <para>
114 It should be understood that passing a request to the next server is
115 only possible if a client was not sent anything yet.
116 That is, if an error or a timeout occurs in the middle of
117 transferring a response, fixing this is impossible.
118 </para>
119
120 </directive>
121
122
123 <directive name="memcached_pass">
124 <syntax><value>address</value></syntax>
125 <default/>
126 <context>location</context>
127 <context>if in location</context>
128
129 <para>
130 Sets an address of the memcached server.
131 An address can be specified as a domain name or an address, and a port,
132 for example,
133 <example>
134 memcached_pass localhost:11211;
135 </example>
136 </para>
137
138 <para>
139 If a domain name resolves to several addresses, all of them will be
140 used in a round-robin fashion.
141 In addition, an address can be specified as a
142 <link doc="ngx_http_upstream_module.xml">server group</link>.
143 </para>
144
145 </directive>
146
147
148 <directive name="memcached_read_timeout">
149 <syntax><value>time</value></syntax>
150 <default>60s</default>
151 <context>http</context>
152 <context>server</context>
153 <context>location</context>
154
155 <para>
156 Defines a timeout for reading a response from the memcached server.
157 A timeout is only set between two successive read operations,
158 not for the transmission of the whole response.
159 If a memcached server does not transmit anything within this time,
160 a connection is closed.
161 </para>
162
163 </directive>
164
165
166 <directive name="memcached_send_timeout">
167 <syntax><value>time</value></syntax>
168 <default>60s</default>
169 <context>http</context>
170 <context>server</context>
171 <context>location</context>
172
173 <para>
174 Sets a timeout for transmitting a request to the memcached server.
175 A timeout is only set between two successive write operations,
176 not for the transmission of the whole request.
177 If a memcached server does not receive anything within this time,
178 a connection is closed.
179 </para>
180
181 </directive>
182
183 </section>
184
185 </module>