Nginx CPU Parameters worker_processes and worker_cpu_affinity instructions for use

Source: Internet
Author: User

Nginx does not turn on using multicore CPUs by default, we can make full use of multicore CPUs by adding worker_cpu_affinity configuration parameters. CPU is the task processing, compute the most critical resources, the more CPU cores, the better performance.

Worker_cpu_affinity This parameter should be used together with worker_processes.

First say worker_processes:

Worker_processes indicates the number of processes Nginx will open, according to the official statement, generally open one is enough, open a few more, can reduce the impact of machine IO. Typically 1 to twice times the total CPU core of the current machine. For example, my machine is dual core, then open 4 is enough.

Then say worker_cpu_affinity:

Worker_processes 4;  Worker_cpu_affinity 0001 0010 0100 1000;  
The above example shows that 4 processes are turned on, and each process is assigned a CPU


The most critical place is not clear, how to represent each CPU?


Well, the 16-core CPU per process assigned to a CPU should be


View CPU status on the server being tested
Top
Then press 1 to see each CPU information



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Nginx CPU Parameters worker_processes and worker_cpu_affinity instructions for use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.