# HG changeset patch # User Ruslan Ermilov # Date 1425570978 -10800 # Node ID 0eb8e261f34953ca90ce998a9765c1b8e9bc5030 # Parent 06322891b4e3c276f6eecd2ecea79a35488a7e8b AIO: clarified the use of both AIO and sendfile on Linux. While here, commented out a note about using AIO module on older versions of FreeBSD. diff -r 06322891b4e3 -r 0eb8e261f349 xml/en/docs/http/ngx_http_core_module.xml --- a/xml/en/docs/http/ngx_http_core_module.xml Sat Feb 28 00:31:18 2015 +0300 +++ b/xml/en/docs/http/ngx_http_core_module.xml Thu Mar 05 18:56:18 2015 +0300 @@ -10,7 +10,7 @@ + rev="37">
@@ -42,6 +42,7 @@ + -For AIO to work, +For AIO to work on FreeBSD, needs to be disabled: location /video/ { + aio on; sendfile off; - aio on; output_buffers 1 64k; } @@ -126,11 +128,21 @@ The same holds true for byte range requests and for FLV requests not from the beginning of a file: reading of unaligned data at the beginning and end of a file will be blocking. -There is no need to turn off - -explicitly, as it is turned off automatically when - -is used. + + + +When both AIO and are enabled on Linux, +AIO is used for files that are larger than or equal to +the size specified in the directive, +while is used for files of smaller sizes +or when is disabled. + +location /video/ { + sendfile on; + aio on; + directio 8m; +} + diff -r 06322891b4e3 -r 0eb8e261f349 xml/ru/docs/http/ngx_http_core_module.xml --- a/xml/ru/docs/http/ngx_http_core_module.xml Sat Feb 28 00:31:18 2015 +0300 +++ b/xml/ru/docs/http/ngx_http_core_module.xml Thu Mar 05 18:56:18 2015 +0300 @@ -10,7 +10,7 @@ + rev="37">
@@ -42,6 +42,7 @@ + -Для работы AIO нужно выключить +Для работы AIO на FreeBSD нужно выключить : location /video/ { + aio on; sendfile off; - aio on; output_buffers 1 64k; } @@ -125,11 +127,21 @@ То же относится к запросам с указанием диапазона запрашиваемых байт (byte-range requests) и к запросам FLV не с начала файла: чтение невыравненных начала и конца ответа будет блокирующимся. -Явно выключать - -не нужно, так как при использовании - -он выключается автоматически. + + + +При одновременном включении AIO и в Linux +для файлов, размер которых больше либо равен указанному +в директиве , будет использоваться AIO, +а для файлов меньшего размера +или при выключенном  — : + +location /video/ { + sendfile on; + aio on; + directio 8m; +} +