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

NameTypeDescription
selectionbinary CPU mask(s) | autoSupply a mask per worker or select automatic binding on Linux or FreeBSD.
auto_maskbinary CPU maskRestrict automatic selection to eligible CPUs; only used with auto.

Working Example

Example Snippetnginx
worker_cpu_affinity 01 10;
Nginx Reference