Mercurial > hg > nginx-site
changeset 1432:9012d7935c9b
Documented that "aio sendfile" is deprecated.
This also made it possible to move the description of sendfile()
pre-loading from "aio" to "sendfile".
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 17 Mar 2015 09:18:35 +0300 |
parents | c4ca69d3e552 |
children | e44df2a4227b |
files | xml/en/docs/http/ngx_http_core_module.xml xml/ru/docs/http/ngx_http_core_module.xml |
diffstat | 2 files changed, 76 insertions(+), 73 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_core_module.xml Tue Mar 10 08:20:21 2015 +0000 +++ b/xml/en/docs/http/ngx_http_core_module.xml Tue Mar 17 09:18:35 2015 +0300 @@ -10,15 +10,14 @@ <module name="Module ngx_http_core_module" link="/en/docs/http/ngx_http_core_module.html" lang="en" - rev="37"> + rev="38"> <section id="directives" name="Directives"> <directive name="aio"> <syntax> <literal>on</literal> | - <literal>off</literal> | - <literal>sendfile</literal></syntax> + <literal>off</literal></syntax> <default>off</default> <context>http</context> <context>server</context> @@ -27,7 +26,13 @@ <para> Enables or disables the use of asynchronous file I/O (AIO) -on FreeBSD and Linux. +on FreeBSD and Linux: +<example> +location /video/ { + aio on; + output_buffers 1 64k; +} +</example> </para> <para> @@ -73,39 +78,6 @@ --> <para> -For AIO to work on FreeBSD, -<link id="sendfile"/> -needs to be disabled: -<example> -location /video/ { - aio on; - sendfile off; - output_buffers 1 64k; -} -</example> -</para> - -<para> -In addition, starting from FreeBSD 5.2.1 and nginx 0.8.12, AIO can -also be used to pre-load data for <c-func>sendfile</c-func>: -<example> -location /video/ { - sendfile on; - tcp_nopush on; - aio sendfile; -} -</example> -In this configuration, <c-func>sendfile</c-func> is called with -the <c-def>SF_NODISKIO</c-def> flag which causes it not to block on disk I/O, -but, instead, report back that the data are not in memory. -nginx then initiates an asynchronous data load by reading one byte. -On the first read, the FreeBSD kernel loads the first 128K bytes -of a file into memory, although next reads will only load data in 16K chunks. -This can be changed using the -<link id="read_ahead"/> directive. -</para> - -<para> On Linux, AIO can be used starting from kernel version 2.6.22. Also, it is necessary to enable <link id="directio"/>, @@ -145,6 +117,10 @@ </example> </para> +<para> +See also the <link id="sendfile"/> directive. +</para> + </directive> @@ -2204,6 +2180,31 @@ <c-func>sendfile</c-func>. </para> +<para> +Starting from nginx 0.8.12 and FreeBSD 5.2.1, +<link id="aio"/> can be used to pre-load data +for <c-func>sendfile</c-func>: +<example> +location /video/ { + sendfile on; + tcp_nopush on; + aio on; +} +</example> +In this configuration, <c-func>sendfile</c-func> is called with +the <c-def>SF_NODISKIO</c-def> flag which causes it not to block on disk I/O, +but, instead, report back that the data are not in memory. +nginx then initiates an asynchronous data load by reading one byte. +On the first read, the FreeBSD kernel loads the first 128K bytes +of a file into memory, although next reads will only load data in 16K chunks. +This can be changed using the +<link id="read_ahead"/> directive. +<note> +Before version 1.7.11, pre-loading could be enabled with +<literal>aio sendfile;</literal>. +</note> +</para> + </directive>
--- a/xml/ru/docs/http/ngx_http_core_module.xml Tue Mar 10 08:20:21 2015 +0000 +++ b/xml/ru/docs/http/ngx_http_core_module.xml Tue Mar 17 09:18:35 2015 +0300 @@ -10,15 +10,14 @@ <module name="Модуль ngx_http_core_module" link="/ru/docs/http/ngx_http_core_module.html" lang="ru" - rev="37"> + rev="38"> <section id="directives" name="Директивы"> <directive name="aio"> <syntax> <literal>on</literal> | - <literal>off</literal> | - <literal>sendfile</literal></syntax> + <literal>off</literal></syntax> <default>off</default> <context>http</context> <context>server</context> @@ -27,7 +26,13 @@ <para> Разрешает или запрещает использование файлового асинхронного ввода-вывода (AIO) -во FreeBSD и Linux. +во FreeBSD и Linux: +<example> +location /video/ { + aio on; + output_buffers 1 64k; +} +</example> </para> <para> @@ -73,38 +78,6 @@ --> <para> -Для работы AIO на FreeBSD нужно выключить -<link id="sendfile"/>: -<example> -location /video/ { - aio on; - sendfile off; - output_buffers 1 64k; -} -</example> -</para> - -<para> -Кроме того, начиная с FreeBSD 5.2.1 и nginx 0.8.12, AIO также можно -использовать для подгрузки данных для <c-func>sendfile</c-func>: -<example> -location /video/ { - sendfile on; - tcp_nopush on; - aio sendfile; -} -</example> -В такой конфигурации функция <c-func>sendfile</c-func> вызывается с флагом -<c-def>SF_NODISKIO</c-def>, в результате чего она не блокируется на диске, а -сообщает об отсутствии данных в памяти. -После этого nginx инициирует асинхронную подгрузку данных, читая один байт. -При этом ядро FreeBSD подгружает в память первые 128K байт файла, однако -при последующих чтениях файл подгружается частями только по 16K. -Изменить это можно с помощью директивы -<link id="read_ahead"/>. -</para> - -<para> В Linux AIO можно использовать только начиная с версии ядра 2.6.22. Кроме того, необходимо также дополнительно включить <link id="directio"/>, @@ -144,6 +117,10 @@ </example> </para> +<para> +См. также директиву <link id="sendfile"/>. +</para> + </directive> @@ -2203,6 +2180,31 @@ <c-func>sendfile</c-func>. </para> +<para> +Начиная с nginx 0.8.12 и FreeBSD 5.2.1, +можно использовать <link id="aio"/> для подгрузки данных +для <c-func>sendfile</c-func>: +<example> +location /video/ { + sendfile on; + tcp_nopush on; + aio on; +} +</example> +В такой конфигурации функция <c-func>sendfile</c-func> вызывается с флагом +<c-def>SF_NODISKIO</c-def>, в результате чего она не блокируется на диске, а +сообщает об отсутствии данных в памяти. +После этого nginx инициирует асинхронную подгрузку данных, читая один байт. +При этом ядро FreeBSD подгружает в память первые 128K байт файла, однако +при последующих чтениях файл подгружается частями только по 16K. +Изменить это можно с помощью директивы +<link id="read_ahead"/>. +<note> +До версии 1.7.11 подгрузка данных включалась с помощью +<literal>aio sendfile;</literal>. +</note> +</para> + </directive>