changeset 767:1bb8b733416a

Clarified the description of the limit_rate directive and fixed the description of the $limit_rate variable.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 16 Nov 2012 18:53:36 +0000
parents 0c5d885656af
children f63b7fa3bf17
files xml/en/docs/http/ngx_http_core_module.xml xml/ru/docs/http/ngx_http_core_module.xml
diffstat 2 files changed, 22 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_core_module.xml
+++ b/xml/en/docs/http/ngx_http_core_module.xml
@@ -10,7 +10,7 @@
 <module name="Module ngx_http_core_module"
         link="/en/docs/http/ngx_http_core_module.html"
         lang="en"
-        rev="9">
+        rev="10">
 
 <section id="directives" name="Directives">
 
@@ -957,22 +957,19 @@ Please note that this will limit access 
 <para>
 Rate limits the transmission of a response to a client.
 The <value>rate</value> is specified in bytes per second.
-Value 0 (the default) disables rate limiting.
+The value 0 disables rate limiting.
 <!--
 The smaller the rate, the more accurate will be the limitation.
 -->
-The limit is per connection, so if a single client opens 2 connections,
-an overall rate will be 2x more than specified by this directive.
+The limit is set per request, so if a client simultaneously opens
+two connections, an overall rate will be twice as much
+as the specified limit.
 </para>
 
 <para>
-This directive is not applicable if one wants to rate limit
-a group of clients on the
-<link id="server"/>
-level.
-If that is the case, the desired limit can be specified in the
-<var>$limit_rate</var>
-variable:
+Rate limit can also be set in the <var>$limit_rate</var> variable.
+It may be useful in cases where rate should be limited
+depending on a certain condition:
 <example>
 server {
 
@@ -987,7 +984,7 @@ server {
 
 <para>
 In addition, rate limit can also be set in the
-<header>X-Accel-Limit-Rate</header> response header field.
+<header>X-Accel-Limit-Rate</header> header field of a proxied server response.
 This ability can be disabled using the
 <link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/>
 and
@@ -2770,7 +2767,8 @@ or an empty string otherwise
 
 <tag-name><var>$limit_rate</var></tag-name>
 <tag-desc>
-allows for connection rate limiting
+setting this variable allows for response rate limiting;
+see <link id="limit_rate"/>
 </tag-desc>
 
 <tag-name><var>$nginx_version</var></tag-name>
--- a/xml/ru/docs/http/ngx_http_core_module.xml
+++ b/xml/ru/docs/http/ngx_http_core_module.xml
@@ -10,7 +10,7 @@
 <module name="Модуль ngx_http_core_module"
         link="/ru/docs/http/ngx_http_core_module.html"
         lang="ru"
-        rev="9">
+        rev="10">
 
 <section id="directives" name="Директивы">
 
@@ -942,21 +942,19 @@ limit_except GET {
 <para>
 Ограничивает скорость передачи ответа клиенту.
 Скорость задаётся в байтах в секунду.
-Значение 0 (установка по умолчанию) отключает ограничение скорости.
+Значение 0 отключает ограничение скорости.
 <!--
 Чем меньше скорость, тем более аккуратным будет ограничение.
 -->
-Ограничение срабатывает только для одного соединения, то есть если
-клиент откроет 2 соединения, то суммарная скорость будет в 2 раза
-выше заданного ограничения.
+Ограничение устанавливается на запрос, поэтому если клиент одновременно
+откроет два соединения, суммарная скорость будет вдвое выше
+заданного ограничения.
 </para>
 
 <para>
-Если необходимо ограничить скорость для части клиентов на уровне
-<link id="server">сервера</link>, то директива <literal>limit_rate</literal>
-для этого не подходит.
-Вместо этого следует задать желаемое ограничение скорости в переменной
-<var>$limit_rate</var>:
+Ограничение скорости можно также задать в переменной <var>$limit_rate</var>.
+Это может быть полезно в случаях, когда скорость нужно ограничивать
+в зависимости от какого-либо условия:
 <example>
 server {
 
@@ -971,7 +969,7 @@ server {
 
 <para>
 Кроме того, ограничение скорости может быть задано в поле
-<header>X-Accel-Limit-Rate</header> заголовка ответа.
+<header>X-Accel-Limit-Rate</header> заголовка ответа проксированного сервера.
 Эту возможность можно запретить с помощью директив
 <link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/>
 и
@@ -2757,7 +2755,8 @@ cookie <value>имя</value>
 
 <tag-name><var>$limit_rate</var></tag-name>
 <tag-desc>
-позволяет ограничивать скорость соединения
+установка этой переменной позволяет ограничивать скорость
+передачи ответа, см. <link id="limit_rate"/>
 </tag-desc>
 
 <tag-name><var>$nginx_version</var></tag-name>