Mercurial > hg > nginx-site
changeset 995:c5ccf511346a
Documented the "fastcgi_buffering" directive.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 02 Oct 2013 13:41:26 +0400 |
parents | f09f77ef45e9 |
children | 1fc988edd0fb |
files | xml/en/docs/http/ngx_http_fastcgi_module.xml xml/ru/docs/http/ngx_http_fastcgi_module.xml |
diffstat | 2 files changed, 98 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_fastcgi_module.xml +++ b/xml/en/docs/http/ngx_http_fastcgi_module.xml @@ -10,7 +10,7 @@ <module name="Module ngx_http_fastcgi_module" link="/en/docs/http/ngx_http_fastcgi_module.html" lang="en" - rev="9"> + rev="10"> <section id="summary"> @@ -84,6 +84,48 @@ It can be made smaller however. </directive> +<directive name="fastcgi_buffering"> +<syntax><literal>on</literal> | <literal>off</literal></syntax> +<default>on</default> +<context>http</context> +<context>server</context> +<context>location</context> +<appeared-in>1.5.6</appeared-in> + +<para> +Enables or disables buffering of responses from the FastCGI server. +</para> + +<para> +When buffering is enabled, nginx receives a response from the FastCGI server +as soon as possible, saving it into the buffers set by the +<link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> directives. +If the whole response does not fit into memory, a part of it can be saved +to a <link id="fastcgi_temp_path">temporary file</link> on the disk. +Writing to temporary files is controlled by the +<link id="fastcgi_max_temp_file_size"/> and +<link id="fastcgi_temp_file_write_size"/> directives. +</para> + +<para> +When buffering is disabled, a response is passed to a client synchronously, +immediately as it is received. +nginx will not try to read the whole response from the FastCGI server. +The maximum size of the data that nginx can receive from the server +at a time is set by the <link id="fastcgi_buffer_size"/> directive. +</para> + +<para> +Buffering can also be enabled or disabled by passing +“<literal>yes</literal>” or “<literal>no</literal>” in the +<header>X-Accel-Buffering</header> response header field. +This capability can be disabled using the +<link id="fastcgi_ignore_headers"/> directive. +</para> + +</directive> + + <directive name="fastcgi_buffers"> <syntax><value>number</value> <value>size</value></syntax> <default>8 4k|8k</default> @@ -110,7 +152,8 @@ This is either 4K or 8K, depending on a <context>location</context> <para> -Limits the total <value>size</value> of buffers that +When <link id="fastcgi_buffering">buffering</link> of responses from the FastCGI +server is enabled, limits the total <value>size</value> of buffers that can be busy sending a response to the client while the response is not yet fully read. In the mean time, the rest of the buffers can be used for reading a response @@ -541,7 +584,7 @@ limit</link> for transmission of a respo <listitem> <header>X-Accel-Buffering</header> enables or disables -buffering of a response; +<link id="fastcgi_buffering">buffering</link> of a response; </listitem> <listitem> @@ -626,7 +669,8 @@ connections to FastCGI servers to functi <context>location</context> <para> -When the whole response does not fit into the memory buffers +When <link id="fastcgi_buffering">buffering</link> of responses from the FastCGI +server is enabled, and the whole response does not fit into the memory buffers set by the <link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> directives, a part of the response can be saved to a temporary file. This directive sets the maximum <value>size</value> of a temporary file.
--- a/xml/ru/docs/http/ngx_http_fastcgi_module.xml +++ b/xml/ru/docs/http/ngx_http_fastcgi_module.xml @@ -10,7 +10,7 @@ <module name="Модуль ngx_http_fastcgi_module" link="/ru/docs/http/ngx_http_fastcgi_module.html" lang="ru" - rev="9"> + rev="10"> <section id="summary"> @@ -83,6 +83,48 @@ location / { </directive> +<directive name="fastcgi_buffering"> +<syntax><literal>on</literal> | <literal>off</literal></syntax> +<default>on</default> +<context>http</context> +<context>server</context> +<context>location</context> +<appeared-in>1.5.6</appeared-in> + +<para> +Разрешает или запрещает использовать буферизацию ответов FastCGI-сервера. +</para> + +<para> +Если буферизация включена, то nginx принимает ответ FastCGI-сервера +как можно быстрее, сохраняя его в буферы, заданные директивами +<link id="fastcgi_buffer_size"/> и <link id="fastcgi_buffers"/>. +Если ответ не вмещается целиком в память, то его часть может быть записана +на диск во <link id="fastcgi_temp_path">временный файл</link>. +Запись во временные файлы контролируется директивами +<link id="fastcgi_max_temp_file_size"/> и +<link id="fastcgi_temp_file_write_size"/>. +</para> + +<para> +Если буферизация выключена, то ответ синхронно передаётся клиенту сразу же +по мере его поступления. +nginx не пытается считать весь ответ FastCGI-сервера. +Максимальный размер данных, который nginx может принять от сервера +за один раз, задаётся директивой <link id="fastcgi_buffer_size"/>. +</para> + +<para> +Буферизация может быть также включена или выключена путём передачи +значения “<literal>yes</literal>” или “<literal>no</literal>” в поле +<header>X-Accel-Buffering</header> заголовка ответа. +Эту возможность можно запретить с помощью директивы +<link id="fastcgi_ignore_headers"/>. +</para> + +</directive> + + <directive name="fastcgi_buffers"> <syntax><value>число</value> <value>размер</value></syntax> <default>8 4k|8k</default> @@ -109,7 +151,8 @@ location / { <context>location</context> <para> -Ограничивает суммарный <value>размер</value> +При включённой <link id="fastcgi_buffering">буферизации</link> ответов +FastCGI-сервера, ограничивает суммарный <value>размер</value> буферов, которые могут быть заняты для отправки ответа клиенту, пока ответ ещё не прочитан целиком. Оставшиеся буферы тем временем могут использоваться для чтения ответа @@ -536,7 +579,7 @@ nginx не передаёт клиенту поля заголовка <header>Status</header> и <listitem> <header>X-Accel-Buffering</header> включает или выключает -буферизацию ответа; +<link id="fastcgi_buffering">буферизацию</link> ответа; </listitem> <listitem> @@ -622,9 +665,10 @@ FastCGI-серверу оставлять соединения открытыми. <context>location</context> <para> -Если ответ не вмещается целиком в буферы памяти, заданные -директивами <link id="fastcgi_buffer_size"/> и <link id="fastcgi_buffers"/>, -часть ответа может быть записана во временный файл. +Если включена <link id="fastcgi_buffering">буферизация</link> ответов +FastCGI-сервера, и ответ не вмещается целиком в буферы памяти, +заданные директивами <link id="fastcgi_buffer_size"/> и +<link id="fastcgi_buffers"/>, часть ответа может быть записана во временный файл. Эта директива задаёт максимальный <value>размер</value> временного файла. Размер данных, сбрасываемых во временный файл за один раз, задаётся директивой <link id="fastcgi_temp_file_write_size"/>.