Optimizing the binding Nginx process to a different CPU

Source: Internet
Author: User

optimizing the binding nginx process to a different CPU

By default, multiple processes may run on a CPU or a core, causing the Nginx process to use hardware resources unevenly, and this optimization is to allocate as many different nginx processes as possible to different CPU processing

Modifying the master configuration file

# Vim Nginx/conf/nginx.conf

Two-core CPU parameter configuration

Worker_processes 2;

worker_cpu_affinity 01 10;

Quad-Core CPU parameter configuration

Worker_processes 4;

Worker_cpu_affinity 0001 0010 0100 1000;

Eight-core CPU parameter configuration

Worker_processes 8;

Worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;

Eight-core CPU parameter configuration

Worker_processes 8;

Worker_cpu_affinity 0001 0010 0100 1000 0001 0010 0100 1000;

# nginx/sbin/nginx-t

# nginx/sbin/nginx-s Reload


Optimizing the binding Nginx process to a different CPU

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.