# Reloading conf

**URL:** <https://www.ruby-forum.com/t/reloading-conf/206486>\
**Category:** NGINX\
**Created:** [May 3, 2011, 12:01am UTC](https://www.ruby-forum.com/t/reloading-conf/206486 "2011-05-03T00:01:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [May 3, 2011, 12:01am UTC](https://www.ruby-forum.com/t/reloading-conf/206486/1 "2011-05-03T00:01:01Z")

</div>

Hi! How reloading my conf can affect my running nginx instances that are  
under load?  
Just made a small test and I saw that some requests to the upstream are  
being lost. I am reloading the same configuration I had, didn’t change  
anything.

Is there any best practice on how to do it? how often? if I should avoid  
something in particular? etc…

Thanks for your help!

Jonathan

---

<div class="post-metadata">

**Author:** ![johanatan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Post date:** [May 3, 2011, 3:03am UTC](https://www.ruby-forum.com/t/reloading-conf/206486/2 "2011-05-03T03:03:07Z")

</div>

Thanks! I will check it again. In general my nginx instances have very  
low cpu and memory usage, way beneath 50%, probably around 10% or even  
less.  
And request in our app are avg 200 or 300 ms, so no long running  
requests.  
We are serving around 15k req/s on 5 nginx instances  
(instance=machine), so maybe we have something wrong in the conf or  
something.  
Anyway, now I understand how it works, so it shouldn’t affect anything.

Thanks again!

Jonathan

---

<div class="post-metadata">

**Author:** ![johanatan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Post date:** [May 3, 2011, 2:28am UTC](https://www.ruby-forum.com/t/reloading-conf/206486/3 "2011-05-03T02:28:03Z")

</div>

Hello!

On Mon, May 02, 2011 at 07:00:18PM -0300, Jonathan L. wrote:

> Hi! How reloading my conf can affect my running nginx instances that are  
> under load?

While reloading nginx master process parses new configuration,  
starts new worker processes and instructs old worker processes to  
gracefully terminate (i.e. finish processing of all requests and  
then exit).

This shouldn’t affect anything but may require additional  
resources (mostly memory). If you don’t have enough memory reload  
may be problematic operation, and it’s generally good idea to make  
sure your running nginx doesn’t consume more than half of your  
server memory under normal load (to make sure it will be possible  
to start additional worker processes on reload).

> Just made a small test and I saw that some requests to the upstream are  
> being lost. I am reloading the same configuration I had, didn’t change  
> anything.

It’s strange you see something being lost. Are you sure you  
actually did reload (i.e. sent SIGHUP to nginx master process)?

> Is there any best practice on how to do it? how often? if I should avoid  
> something in particular? etc…

General practice is to reload config when you’ve changed it.

If you are doing reloads often - you may want to make sure  
previous reload was completed (i.e. old workers terminated) before  
doing another one (there is nothing fatal if it’s not, but see  
above about resources). Please note that with some use cases  
(long-running requests, downloads and so on) reload may take  
several hours or even more.

Maxim D.
