Opened 3 years ago

Closed 3 years ago

#1311 closed defect (duplicate)

worker_processes auto mode does not consider isolated CPUs

Reported by: affinioso@… Owned by:
Priority: minor Milestone:
Component: other Version: 1.13.x
Keywords: Cc:
uname -a:
nginx -V: nginx/1.10.3

Description

When worker_processes is set to "auto" - it does not take into consideration isolated CPUs in case such exist - and it's possible that a system which has 16 CPUs, of which 8 are isolated - that runs nginx with this option, to result in 16 nginx processes instead of 8.

Change History (1)

comment:1 by Maxim Dounin, 3 years ago

Resolution: duplicate
Status: newclosed

By "isolated CPUs" you mean Linux kernel isolcpus= option? This option merely configures default CPU affinity, and it is still possible for nginx workers to run on "isolated" CPUs when using taskset and/or worker_cpu_affinity. For example, on a system with 3 CPUs with isolcpus=1-2 a configuration like this:

worker_processes auto;
worker_cpu_affinity auto 111;

will correctly start 3 worker process bound to 1st, 2nd, and 3rd CPUs respectively.

Overall this seems to be a duplicate of ticket #1151, which also about improving detection of number of CPUs for worker_processes auto;.

Note: See TracTickets for help on using tickets.