Core directives
worker_cpu_affinity (Core directives)
Restricts worker CPU placement on supported platforms; masks must match the allowed CPU set.
Formal Syntax & Structure
nginx syntaxnginx
worker_cpu_affinity cpumask ...; or worker_cpu_affinity auto [cpumask];Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| selection | binary CPU mask(s) | auto | Supply a mask per worker or select automatic binding on Linux or FreeBSD. |
| auto_mask | binary CPU mask | Restrict automatic selection to eligible CPUs; only used with auto. |
Working Example
Example Snippetnginx
worker_cpu_affinity 01 10;