# HG changeset patch # User Ruslan Ermilov # Date 1426694502 -10800 # Node ID 2333e08e277d16723b7b4e6d75eb206d4b27849e # Parent 54ed6b72ad3b00fc0f998c8a9ab6f58b683d625a Documented thread pools. diff -r 54ed6b72ad3b -r 2333e08e277d xml/en/docs/http/ngx_http_core_module.xml --- a/xml/en/docs/http/ngx_http_core_module.xml Wed Mar 18 14:19:44 2015 +0000 +++ b/xml/en/docs/http/ngx_http_core_module.xml Wed Mar 18 19:01:42 2015 +0300 @@ -17,7 +17,8 @@ on | - off + off | + threads[=pool] off http server @@ -118,6 +119,35 @@ +Finally, files can be read and sent +using multi-threading (1.7.11), +without blocking a worker process: + +location /video/ { + sendfile on; + aio threads; +} + +Read and send file operations are offloaded to threads of the specified +pool. +If the pool name is omitted, +the pool with the name “default” is used. +The pool name can also be set with variables: + +aio threads=pool$disk; + +By default, multi-threading is disabled, it should be +enabled with the +--with-threads configuration parameter. +Currently, multi-threading is compatible only with the +, +, +and + methods. +Multi-threaded sending of files is only supported on Linux. + + + See also the directive. diff -r 54ed6b72ad3b -r 2333e08e277d xml/en/docs/ngx_core_module.xml --- a/xml/en/docs/ngx_core_module.xml Wed Mar 18 14:19:44 2015 +0000 +++ b/xml/en/docs/ngx_core_module.xml Wed Mar 18 19:01:42 2015 +0300 @@ -397,6 +397,39 @@ + + + name + threads=number + [max_queue=number] +default threads=32 max_queue=65536 +main +1.7.11 + + +Defines named thread pools +used for multi-threaded reading and sending of files +without blocking +worker processes. + + + +The threads parameter +defines the number of threads in the pool. + + + +In the event that all threads in the pool are busy, +a new task will wait in the queue. +The max_queue parameter limits the number +of tasks allowed to be waiting in the queue. +By default, up to 65536 tasks can wait in the queue. +When the queue overflows, the task is completed with an error. + + + + + interval diff -r 54ed6b72ad3b -r 2333e08e277d xml/ru/docs/http/ngx_http_core_module.xml --- a/xml/ru/docs/http/ngx_http_core_module.xml Wed Mar 18 14:19:44 2015 +0000 +++ b/xml/ru/docs/http/ngx_http_core_module.xml Wed Mar 18 19:01:42 2015 +0300 @@ -17,7 +17,8 @@ on | - off + off | + threads[=pool] off http server @@ -118,6 +119,35 @@ +Кроме того, читать и отправлять +файлы можно в многопоточном режиме (1.7.11), +не блокируя при этом рабочий процесс: + +location /video/ { + sendfile on; + aio threads; +} + +Операции чтения или отправки файлов будут обрабатываться потоками из указанного +пула. +Если пул потоков не задан явно, +используется пул с именем “default”. +Имя пула может быть задано при помощи переменных: + +aio threads=pool$disk; + +По умолчанию поддержка многопоточности выключена, её сборку следует +разрешить с помощью конфигурационного параметра +--with-threads. +В настоящий момент многопоточность совместима только с методами +, + +и +. +Отправка файлов в многопоточном режиме поддерживается только на Linux. + + + См. также директиву . diff -r 54ed6b72ad3b -r 2333e08e277d xml/ru/docs/ngx_core_module.xml --- a/xml/ru/docs/ngx_core_module.xml Wed Mar 18 14:19:44 2015 +0000 +++ b/xml/ru/docs/ngx_core_module.xml Wed Mar 18 19:01:42 2015 +0300 @@ -395,6 +395,39 @@ + + + имя + threads=число + [max_queue=число] +default threads=32 max_queue=65536 +main +1.7.11 + + +Задаёт именованные пулы потоков, +используемые для многопоточной обработки операций чтения и отправки файлов +без блокирования +рабочего процесса. + + + +Параметр threads +задаёт число потоков в пуле. + + + +Если все потоки из пула заняты выполнением заданий, +новое задание будет ожидать своего выполнения в очереди. +Параметр max_queue ограничивает число заданий, +ожидающих своего выполнения в очереди. +По умолчанию в очереди может находиться до 65536 заданий. +При переполнении очереди задание завершается с ошибкой. + + + + + интервал