Mercurial > hg > nginx-site
changeset 469:8275e169f77b
Documented the "worker_cpu_affinity" directive.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 28 Mar 2012 13:34:19 +0000 |
parents | 31e81dcc4ffd |
children | 5efd5404094f |
files | xml/en/docs/ngx_core_module.xml xml/ru/docs/ngx_core_module.xml |
diffstat | 2 files changed, 75 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/ngx_core_module.xml Wed Mar 28 07:50:06 2012 +0000 +++ b/xml/en/docs/ngx_core_module.xml Wed Mar 28 13:34:19 2012 +0000 @@ -293,6 +293,43 @@ </directive> +<directive name="worker_cpu_affinity"> +<syntax><value>cpumask</value> ...</syntax> +<default/> +<context>main</context> + +<para> +Binds worker processes to the sets of CPUs. +Each CPU set is represented by a bitmask of allowed to use CPUs. +There should be a separate set defined for each of the worker processes. +By default, worker processes are not bound to any specific CPUs. +</para> + +<para> +For example, +<example> +worker_processes 4; +worker_cpu_affinity 0001 0010 0100 1000; +</example> +binds each worker process to a separate CPU, while +<example> +worker_processes 2; +worker_cpu_affinity 0101 1010; +</example> +binds the first worker process to CPU0/CPU2, +and the second worker process to CPU1/CPU3. +The second example is suitable for hyper-threading. +</para> + +<para> +<note> +The directive is only available on FreeBSD and Linux. +</note> +</para> + +</directive> + + <directive name="worker_priority"> <syntax><value>number</value></syntax> <default>0</default>
--- a/xml/ru/docs/ngx_core_module.xml Wed Mar 28 07:50:06 2012 +0000 +++ b/xml/ru/docs/ngx_core_module.xml Wed Mar 28 13:34:19 2012 +0000 @@ -290,6 +290,44 @@ </directive> +<directive name="worker_cpu_affinity"> +<syntax><value>маска_CPU</value> ...</syntax> +<default/> +<context>main</context> + +<para> +Привязывает рабочие процессы к группам процессоров. +Каждая группа процессоров задаётся битовой маской +разрешённых к использованию процессоров. +Для каждого рабочего процесса должна быть задана отдельная группа. +По умолчанию рабочие процессы не привязаны к конкретным процессорам. +</para> + +<para> +Например, +<example> +worker_processes 4; +worker_cpu_affinity 0001 0010 0100 1000; +</example> +привязывает каждый рабочий процесс к отдельному процессору, тогда как +<example> +worker_processes 2; +worker_cpu_affinity 0101 1010; +</example> +привязывает первый рабочий процесс к CPU0/CPU2, +а второй — к CPU1/CPU3. +Второй пример пригоден для hyper-threading. +</para> + +<para> +<note> +Директива доступна только на FreeBSD и Linux. +</note> +</para> + +</directive> + + <directive name="worker_priority"> <syntax><value>число</value></syntax> <default>0</default>