# When reloading nginx-0.8.54, number of workers increases

**URL:** <https://www.ruby-forum.com/t/when-reloading-nginx-0-8-54-number-of-workers-increases/219998>\
**Category:** NGINX\
**Created:** [May 24, 2012, 12:11pm UTC](https://www.ruby-forum.com/t/when-reloading-nginx-0-8-54-number-of-workers-increases/219998 "2012-05-24T12:11:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [May 24, 2012, 12:11pm UTC](https://www.ruby-forum.com/t/when-reloading-nginx-0-8-54-number-of-workers-increases/219998/1 "2012-05-24T12:11:21Z")

</div>

Hello.

This is the situation:

I giva heavy traffic continually by using ApacheBench, say:  
while :; do ab -n 100000 -c 1000 '[http://localhost/](http://localhost/); done.  
And also I reload nginx continually by using while syntax.  
When looking at the master/worker process by using ps command,  
the number of worker processes increase in a moment.

[removed\_email\_address@domain.invalid ~]$ ps aux|grep nginx  
nobody 16879 0.0 0.0 4112 884 ? R 18:43 0:00 nginx:  
worker process  
nobody 16881 0.0 0.0 4168 1160 ? S 18:43 0:00 nginx:  
worker process  
root 16882 0.0 0.0 0 0 pts/3 Z+ 18:43 0:00 [nginx]  
  
root 16883 0.0 0.0 3976 392 ? R 18:43 0:00 nginx:  
master process ./sbin/nginx  
irteam 16885 0.0 0.0 5200 772 pts/6 R+ 18:43 0:00 grep  
nginx  
root 23791 0.3 0.0 3976 1004 ? Rs 18:00 0:08 nginx:  
master process ./sbin/nginx  
[removed\_email\_address@domain.invalid ~]$ ps aux|grep nginx  
nobody 17610 0.0 0.0 4116 920 ? R 18:43 0:00 nginx:  
worker process  
nobody 17616 0.0 0.0 4112 896 ? R 18:43 0:00 nginx:  
worker process  
nobody 17620 0.0 0.0 4112 904 ? S 18:43 0:00 nginx:  
worker process is shutting down  
nobody 17623 0.0 0.0 4248 1232 ? R 18:43 0:00 nginx:  
worker process is shutting down  
nobody 17625 0.0 0.0 4112 1080 ? S 18:43 0:00 nginx:  
worker process  
irteam 17628 0.0 0.0 5200 752 pts/6 R+ 18:43 0:00 grep  
nginx  
root 23791 0.3 0.0 3976 1004 ? Ss 18:00 0:08 nginx:  
master process ./sbin/nginx  
[removed\_email\_address@domain.invalid ~]$ ps aux|grep nginx  
nobody 18071 0.0 0.0 4116 828 ? R 18:43 0:00 nginx:  
worker process  
irteam 18082 0.0 0.0 5200 752 pts/6 R+ 18:43 0:00 grep  
nginx  
nobody 18083 0.0 0.0 4112 864 ? S 18:43 0:00 nginx:  
worker process  
root 23791 0.3 0.0 3976 1004 ? Ss 18:00 0:08 nginx:  
master process ./sbin/nginx  
[removed\_email\_address@domain.invalid ~]$ ps aux|grep nginx  
nobody 18361 135 0.0 4244 1236 ? R 18:43 0:01 nginx:  
worker process  
root 18408 0.0 0.0 8896 1604 pts/3 R+ 18:43 0:00 sudo  
./sbin/nginx -s reload  
irteam 18410 0.0 0.0 5200 756 pts/6 R+ 18:43 0:00 grep  
nginx  
root 23791 0.3 0.0 3980 1004 ? Rs 18:00 0:08 nginx:  
master process ./sbin/nginx

I use the default configuration which is generated when installed  
nginx-0.8.54  
so worker\_process is 1 and add no third party module.

Please help me.  
Thank you!

Posted at Nginx Forum:

> **[When reloading nginx-0.8.54, number of workers increases](https://forum.nginx.org/read.php?2,226790,226790#msg-226790)**
>
> Hello. This is the situation: I giva heavy traffic continually by using ApacheBench, say: while :; do ab -n 100000 -c 1000 'http://localhost/; done. And also I reload nginx continually by using while syntax. When looking at the master/worker process

---

<div class="post-metadata">

**Author:** ![zealot83](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e47c2d/32.png) [@zealot83](https://www.ruby-forum.com/u/zealot83)\
**Post date:** [May 24, 2012, 12:33pm UTC](https://www.ruby-forum.com/t/when-reloading-nginx-0-8-54-number-of-workers-increases/219998/2 "2012-05-24T12:33:11Z")

</div>

Hello!

On Thu, May 24, 2012 at 06:10:47AM -0400, zealot83 wrote:

> Hello.
> 
> This is the situation:
> 
> I giva heavy traffic continually by using ApacheBench, say:  
> while :; do ab -n 100000 -c 1000 '[http://localhost/](http://localhost/); done.  
> And also I reload nginx continually by using while syntax.  
> When looking at the master/worker process by using ps command,  
> the number of worker processes increase in a moment.

This is normal. While reloading configuration nginx starts new  
worker processes and then shutdowns old ones. Old workers exit as  
long as they finish processing of requests in progress.

Maxim D.

---

<div class="post-metadata">

**Author:** ![zealot83](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e47c2d/32.png) [@zealot83](https://www.ruby-forum.com/u/zealot83)\
**Post date:** [May 24, 2012, 1:18pm UTC](https://www.ruby-forum.com/t/when-reloading-nginx-0-8-54-number-of-workers-increases/219998/3 "2012-05-24T13:18:36Z")

</div>

On Thursday 24 May 2012 14:10:47 zealot83 wrote:

> [removed\_email\_address@domain.invalid ~]$ ps aux|grep nginx  
> root 23791 0.3 0.0 3976 1004 ? Rs 18:00 0:08 nginx:  
> nobody 17625 0.0 0.0 4112 1080 ? S 18:43 0:00 nginx:  
> nobody 18083 0.0 0.0 4112 864 ? S 18:43 0:00 nginx:  
> root 23791 0.3 0.0 3980 1004 ? Rs 18:00 0:08 nginx:  
> master process ./sbin/nginx
> 
> I use the default configuration which is generated when installed  
> nginx-0.8.54  
> so worker\_process is 1 and add no third party module.
> 
> Please help me.  
> Thank you!

Here is explained:

> **[Controlling nginx](http://nginx.org/en/docs/control.html#reconfiguration)**
>
> nginx can be controlled with signals. The process ID of the master process is written to the file /usr/local/nginx/logs/nginx.pid by default. This name may be changed at configuration time, or in nginx.conf using the pid directive. The master process...

wbr, Valentin V. Bartenev

---

<div class="post-metadata">

**Author:** ![zealot83](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e47c2d/32.png) [@zealot83](https://www.ruby-forum.com/u/zealot83)\
**Post date:** [May 24, 2012, 1:27pm UTC](https://www.ruby-forum.com/t/when-reloading-nginx-0-8-54-number-of-workers-increases/219998/4 "2012-05-24T13:27:55Z")

</div>

Thank you for your reply, Maxim.

If the old workers do not exit for long time,  
what part should I investigate.  
Actually, I use nginx with my own patch.

Thanks again.

Posted at Nginx Forum:

> **[Re: When reloading nginx-0.8.54, number of workers increases](https://forum.nginx.org/read.php?2,226790,226796#msg-226796)**
>
> Hello. This is the situation: I giva heavy traffic continually by using ApacheBench, say: while :; do ab -n 100000 -c 1000 'http://localhost/; done. And also I reload nginx continually by using while syntax. When looking at the master/worker process
