How many Nginx processes should there be?
This is the number of your worker processes of nginx
. The default configuration has 4 worker processes. They are here that the web server can handle multiple connections very fast. One of them is the master process see the output of ps fax | grep nginx
:
user@host:~# ps fax | grep nginx
6885 ? Ss 0:00 nginx: master process /usr/sbin/nginx
6886 ? S 0:00 \_ nginx: worker process
6887 ? S 0:00 \_ nginx: worker process
6888 ? S 0:00 \_ nginx: worker process
6889 ? S 0:00 \_ nginx: worker process
You see there is a master process and 4 child processes (workers).
Ot determine how many worker processes are configured type:
user@host:~# grep worker_processes /etc/nginx/nginx.conf
worker_processes 4;