Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

How many worker_processes should I use in Nginx?

Answer:

In the Nginx configuration (nginx.conf), the default worker_processes is 1.

e.g.

worker_processes  1;

However, as nowadays most servers are multi-core/multi-processor machine, it is a waste to only use 1 worker process.

The recommended worker_processes is equal to the number of CPU cores, e.g. if you have a dual Quad Core server, you should set to 8.

worker_processes  8;
  1. Calculating the max client in Nginx
  2. Adding SSL suport in Nginx
  3. Enable Expire header in Nginx
  4. Enable debug log for Nginx
  5. How to define variable in nginx

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>