Mercurial > hg > nginx-site
annotate xml/ru/docs/stream/ngx_stream_limit_conn_module.xml @ 1851:9463f1412255
Documented ngx_google_perftools_module.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Mon, 05 Dec 2016 21:01:46 +0300 |
parents | ab56dcd73af2 |
children | 5d7fd7d9a2b6 |
rev | line source |
---|---|
222
bfe3eff81d04
Removed redundant encoding specification.
Ruslan Ermilov <ru@nginx.com>
parents:
207
diff
changeset
|
1 <?xml version="1.0"?> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
diff
changeset
|
7 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
10 <module name="Модуль ngx_stream_limit_conn_module" |
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
11 link="/ru/docs/stream/ngx_stream_limit_conn_module.html" |
589 | 12 lang="ru" |
1744
ab56dcd73af2
Added variables to stream hash, limit_conn_zone, proxy_bind.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1699
diff
changeset
|
13 rev="3"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 |
110
40eec261c2a6
Added proper support for anonymous sections, notably for the summary.
Ruslan Ermilov <ru@nginx.com>
parents:
102
diff
changeset
|
15 <section id="summary"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 <para> |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
18 Модуль <literal>ngx_stream_limit_conn_module</literal> (1.9.3) позволяет |
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
19 ограничить |
966 | 20 число соединений по заданному ключу, в частности, число соединений с одного |
21 IP-адреса. | |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
22 </para> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
23 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 |
365 | 27 <section id="example" name="Пример конфигурации"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 <example> |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
31 stream { |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
32 limit_conn_zone $binary_remote_addr zone=addr:10m; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 ... |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 server { |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 ... |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
40 limit_conn addr 1; |
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
41 limit_conn_log_level error; |
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
42 } |
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
43 } |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
46 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
47 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 |
365 | 50 <section id="directives" name="Директивы"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
52 <directive name="limit_conn"> |
271 | 53 <syntax><value>зона</value> <value>число</value></syntax> |
99
1d315ef37215
The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents:
76
diff
changeset
|
54 <default/> |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
55 <context>stream</context> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
56 <context>server</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
58 <para> |
575
ebcb351d9eb3
Consistently using the term "shared memory zone".
Ruslan Ermilov <ru@nginx.com>
parents:
390
diff
changeset
|
59 Задаёт зону разделяемой памяти и максимально допустимое число соединений |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
60 для одного значения ключа. |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
61 При превышении этого числа сервер закроет соединение. |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
62 Например, директивы |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
63 <example> |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
64 limit_conn_zone $binary_remote_addr zone=addr:10m; |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
65 |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
66 server { |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
67 ... |
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
68 limit_conn addr 1; |
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
69 } |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 </example> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
71 разрешают одновременно обрабатывать не более одного соединения с одного |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
72 IP-адреса. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
73 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
74 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
75 <para> |
271 | 76 Допустимо одновременное указание нескольких директив |
77 <literal>limit_conn</literal>, | |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
78 при этом будет срабатывать любое из ограничений. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
79 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 <para> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
82 Директивы наследуются с предыдущего уровня при условии, что на данном уровне |
271 | 83 не описаны свои директивы <literal>limit_conn</literal>. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
86 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
87 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
88 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
89 <directive name="limit_conn_log_level"> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
90 <syntax> |
271 | 91 <literal>info</literal> | |
92 <literal>notice</literal> | | |
93 <literal>warn</literal> | | |
94 <literal>error</literal></syntax> | |
102
c76a257f3fd4
The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents:
99
diff
changeset
|
95 <default>error</default> |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
96 <context>stream</context> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
97 <context>server</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
98 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
99 <para> |
380 | 100 Задаёт желаемый уровень записи в лог случаев ограничения |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
101 числа соединений. |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
102 </para> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
103 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
104 </directive> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
105 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
106 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
107 <directive name="limit_conn_zone"> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
108 <syntax> |
1320
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
109 <value>ключ</value> |
271 | 110 <literal>zone</literal>=<value>название</value>:<value>размер</value></syntax> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
111 <default/> |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
112 <context>stream</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
113 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
114 <para> |
575
ebcb351d9eb3
Consistently using the term "shared memory zone".
Ruslan Ermilov <ru@nginx.com>
parents:
390
diff
changeset
|
115 Задаёт параметры зоны разделяемой памяти, которая хранит состояние |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
116 для разных значений ключа. |
966 | 117 Состояние в частности содержит текущее число соединений. |
1744
ab56dcd73af2
Added variables to stream hash, limit_conn_zone, proxy_bind.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1699
diff
changeset
|
118 В качестве <value>ключа</value> может использоваться текст, переменные |
ab56dcd73af2
Added variables to stream hash, limit_conn_zone, proxy_bind.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1699
diff
changeset
|
119 и их комбинации (1.11.2). |
1320
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
120 Запросы с пустым значением ключа не учитываются. |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
121 Пример использования: |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
122 <example> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
123 limit_conn_zone $binary_remote_addr zone=addr:10m; |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
124 </example> |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
125 Здесь в качестве ключа используется IP-адрес клиента, |
1744
ab56dcd73af2
Added variables to stream hash, limit_conn_zone, proxy_bind.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1699
diff
changeset
|
126 задаваемый переменной <literal>$binary_remote_addr</literal>. |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
127 Длина значения <literal>$binary_remote_addr</literal> |
1699
6c96a644b0b3
Corrected description of $binary_remote_addr and saved state.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1517
diff
changeset
|
128 равна 4 байтам для IPv4-адресов или 16 байтам для IPv6-адресов. |
6c96a644b0b3
Corrected description of $binary_remote_addr and saved state.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1517
diff
changeset
|
129 При этом размер состояния всегда равен 32 или 64 байтам |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
130 на 32-битных платформах и 64 байтам на 64-битных. |
367
f4033b9bc4ec
- Removed unnecessary instances of unbreakable space.
Ruslan Ermilov <ru@nginx.com>
parents:
365
diff
changeset
|
131 В зоне размером 1 мегабайт может разместиться около 32 тысяч состояний |
966 | 132 размером 32 байта или 16 тысяч состояний размером 64 байта. |
1517
53ae63cb4cfa
Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
133 При переполнении зоны сервер закроет соединение. |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
134 </para> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
135 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
136 </directive> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
137 |
365 | 138 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
139 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
140 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 </module> |