# HG changeset patch # User Ruslan Ermilov # Date 1426573115 -10800 # Node ID 9012d7935c9b0cdac71c7f0a4714e32dac1c3a6c # Parent c4ca69d3e5525dd937799e6c997ccbb3991487fd Documented that "aio sendfile" is deprecated. This also made it possible to move the description of sendfile() pre-loading from "aio" to "sendfile". diff -r c4ca69d3e552 -r 9012d7935c9b xml/en/docs/http/ngx_http_core_module.xml --- 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 @@ + rev="38">
on | - off | - sendfile + off off http server @@ -27,7 +26,13 @@ Enables or disables the use of asynchronous file I/O (AIO) -on FreeBSD and Linux. +on FreeBSD and Linux: + +location /video/ { + aio on; + output_buffers 1 64k; +} + @@ -73,39 +78,6 @@ --> -For AIO to work on FreeBSD, - -needs to be disabled: - -location /video/ { - aio on; - sendfile off; - output_buffers 1 64k; -} - - - - -In addition, starting from FreeBSD 5.2.1 and nginx 0.8.12, AIO can -also be used to pre-load data for sendfile: - -location /video/ { - sendfile on; - tcp_nopush on; - aio sendfile; -} - -In this configuration, sendfile is called with -the SF_NODISKIO 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 - directive. - - - On Linux, AIO can be used starting from kernel version 2.6.22. Also, it is necessary to enable , @@ -145,6 +117,10 @@ + +See also the directive. + + @@ -2204,6 +2180,31 @@ sendfile. + +Starting from nginx 0.8.12 and FreeBSD 5.2.1, + can be used to pre-load data +for sendfile: + +location /video/ { + sendfile on; + tcp_nopush on; + aio on; +} + +In this configuration, sendfile is called with +the SF_NODISKIO 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 + directive. + +Before version 1.7.11, pre-loading could be enabled with +aio sendfile;. + + + diff -r c4ca69d3e552 -r 9012d7935c9b xml/ru/docs/http/ngx_http_core_module.xml --- 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 @@ + rev="38">
on | - off | - sendfile + off off http server @@ -27,7 +26,13 @@ Разрешает или запрещает использование файлового асинхронного ввода-вывода (AIO) -во FreeBSD и Linux. +во FreeBSD и Linux: + +location /video/ { + aio on; + output_buffers 1 64k; +} + @@ -73,38 +78,6 @@ --> -Для работы AIO на FreeBSD нужно выключить -: - -location /video/ { - aio on; - sendfile off; - output_buffers 1 64k; -} - - - - -Кроме того, начиная с FreeBSD 5.2.1 и nginx 0.8.12, AIO также можно -использовать для подгрузки данных для sendfile: - -location /video/ { - sendfile on; - tcp_nopush on; - aio sendfile; -} - -В такой конфигурации функция sendfile вызывается с флагом -SF_NODISKIO, в результате чего она не блокируется на диске, а -сообщает об отсутствии данных в памяти. -После этого nginx инициирует асинхронную подгрузку данных, читая один байт. -При этом ядро FreeBSD подгружает в память первые 128K байт файла, однако -при последующих чтениях файл подгружается частями только по 16K. -Изменить это можно с помощью директивы -. - - - В Linux AIO можно использовать только начиная с версии ядра 2.6.22. Кроме того, необходимо также дополнительно включить , @@ -144,6 +117,10 @@ + +См. также директиву . + + @@ -2203,6 +2180,31 @@ sendfile. + +Начиная с nginx 0.8.12 и FreeBSD 5.2.1, +можно использовать для подгрузки данных +для sendfile: + +location /video/ { + sendfile on; + tcp_nopush on; + aio on; +} + +В такой конфигурации функция sendfile вызывается с флагом +SF_NODISKIO, в результате чего она не блокируется на диске, а +сообщает об отсутствии данных в памяти. +После этого nginx инициирует асинхронную подгрузку данных, читая один байт. +При этом ядро FreeBSD подгружает в память первые 128K байт файла, однако +при последующих чтениях файл подгружается частями только по 16K. +Изменить это можно с помощью директивы +. + +До версии 1.7.11 подгрузка данных включалась с помощью +aio sendfile;. + + +