Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_upstream_module.xml @ 526:4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 05 Jun 2012 21:42:57 +0000 |
parents | 1fb1c077658b |
children | fb630c3c5039 |
comparison
equal
deleted
inserted
replaced
525:1dca638da1eb | 526:4f907cde0382 |
---|---|
58 in which case client requests will be passed to another server and | 58 in which case client requests will be passed to another server and |
59 most probably it will also be the same server. | 59 most probably it will also be the same server. |
60 </para> | 60 </para> |
61 | 61 |
62 <para> | 62 <para> |
63 It is not possible to specify a weight for servers using the | |
64 <literal>ip_hash</literal> balancing method. | |
65 If one of the servers needs to be temporarily removed, it should | 63 If one of the servers needs to be temporarily removed, it should |
66 be marked with the <literal>down</literal> parameter in | 64 be marked with the <literal>down</literal> parameter in |
67 order to preserve the current hashing of client IP addresses. | 65 order to preserve the current hashing of client IP addresses. |
68 </para> | 66 </para> |
69 | 67 |
77 server backend2.example.com; | 75 server backend2.example.com; |
78 server backend3.example.com <emphasis>down</emphasis>; | 76 server backend3.example.com <emphasis>down</emphasis>; |
79 server backend4.example.com; | 77 server backend4.example.com; |
80 } | 78 } |
81 </example> | 79 </example> |
80 </para> | |
81 | |
82 <para> | |
83 <note> | |
84 Until version 1.3.1 it was not possible to specify a weight for | |
85 servers using the <literal>ip_hash</literal> balancing method. | |
86 </note> | |
82 </para> | 87 </para> |
83 | 88 |
84 </directive> | 89 </directive> |
85 | 90 |
86 | 91 |
202 </para> | 207 </para> |
203 | 208 |
204 </directive> | 209 </directive> |
205 | 210 |
206 | 211 |
212 <directive name="least_conn"> | |
213 <syntax/> | |
214 <default/> | |
215 <context>upstream</context> | |
216 <appeared-in>1.3.1</appeared-in> | |
217 | |
218 <para> | |
219 Specifies that a group should use a balancing method where a request | |
220 is passed to the server with the least number of active connections, | |
221 taking into account weights of servers. | |
222 If there are several such servers, they are tried in a | |
223 weighted round-robin fashion. | |
224 </para> | |
225 | |
226 </directive> | |
227 | |
228 | |
207 <directive name="server"> | 229 <directive name="server"> |
208 <syntax><value>name</value> [<value>parameters</value>]</syntax> | 230 <syntax><value>name</value> [<value>parameters</value>]</syntax> |
209 <default/> | 231 <default/> |
210 <context>upstream</context> | 232 <context>upstream</context> |
211 | 233 |
309 } | 331 } |
310 </example> | 332 </example> |
311 </para> | 333 </para> |
312 | 334 |
313 <para> | 335 <para> |
314 Requests are distributed between servers in a round-robin fashion, | 336 Requests are distributed between servers in a |
315 taking into account the weights of servers. | 337 weighted round-robin fashion. |
316 In the above example, each 7 requests will be distributed as follows: | 338 In the above example, each 7 requests will be distributed as follows: |
317 5 requests to <literal>backend1.example.com</literal> | 339 5 requests to <literal>backend1.example.com</literal> |
318 and one request to each of second and third servers. | 340 and one request to each of second and third servers. |
319 If an error occurs when communicating with the server, a request will | 341 If an error occurs when communicating with the server, a request will |
320 be passed to the next server, and so on until all of the functioning | 342 be passed to the next server, and so on until all of the functioning |