Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Just installing Nginx on a fresh ubuntu server 12.04.

ps -e | grep nginx at first returned nothing so i ran nginxwhich appeared to get things started.

Running ps -e | grep nginx now returns a number of identical processes?

 1793 ?        00:00:00 nginx
 1794 ?        00:00:00 nginx
 1795 ?        00:00:00 nginx
 1796 ?        00:00:00 nginx
 1797 ?        00:00:00 nginx

Everything appears to be running, however I'm interested to know why there are multiples, what they're doing and what would happen to my server if I were to kill just one of them?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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;
share|improve this answer
    
Ah of course! I set it up with 4 workers! Duh. Thanks for the explanation! –  Huw Jan 3 at 19:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.