# Suggestions on scaling with nginx

**URL:** <https://www.ruby-forum.com/t/suggestions-on-scaling-with-nginx/221720>\
**Category:** NGINX\
**Created:** [July 27, 2012, 10:49am UTC](https://www.ruby-forum.com/t/suggestions-on-scaling-with-nginx/221720 "2012-07-27T10:49:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [July 27, 2012, 10:49am UTC](https://www.ruby-forum.com/t/suggestions-on-scaling-with-nginx/221720/1 "2012-07-27T10:49:57Z")

</div>

Hi ,

I have various upsteram configurations. I want to add or remove servers  
(scale up or down) from the upstream based on some parameters. Please  
provide your suggestions.

One way that I think of is to update the upstream conf and perform a  
SIGHUP. Does not feel very good about it as I have to do it say 5 times  
a day and it the my main LB.

Thanks  
Amod

Posted at Nginx Forum:

> **[suggestions on scaling with nginx](https://forum.nginx.org/read.php?2,229028,229028#msg-229028)**
>
> Hi , I have various upsteram configurations. I want to add or remove servers (scale up or down) from the upstream based on some parameters. Please provide your suggestions. One way that I think of is to update the upstream conf and perform a SIGHUP....

---

<div class="post-metadata">

**Author:** ![amodpandey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@amodpandey](https://www.ruby-forum.com/u/amodpandey)\
**Post date:** [July 27, 2012, 11:16am UTC](https://www.ruby-forum.com/t/suggestions-on-scaling-with-nginx/221720/2 "2012-07-27T11:16:15Z")

</div>

> One way that I think of is to update the upstream conf and perform a SIGHUP.  
> Does not feel very good about it as I have to do it  
> say 5 times a day and it the my main LB.

Why do you have to change upstreams 5 times a day?

p.s. nginx config reload is seamless

rr

---

<div class="post-metadata">

**Author:** ![amodpandey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@amodpandey](https://www.ruby-forum.com/u/amodpandey)\
**Post date:** [July 27, 2012, 11:38am UTC](https://www.ruby-forum.com/t/suggestions-on-scaling-with-nginx/221720/3 "2012-07-27T11:38:27Z")

</div>

Hello!

On Fri, Jul 27, 2012 at 04:49:41AM -0400, amodpandey wrote:

> I have various upsteram configurations. I want to add or remove servers  
> (scale up or down) from the upstream based on some parameters. Please  
> provide your suggestions.
> 
> One way that I think of is to update the upstream conf and perform a  
> SIGHUP. Does not feel very good about it as I have to do it say 5 times  
> a day and it the my main LB.

Changing config and doing a reload is ok as long as you don’t do  
it more often than old worker processes exit. Something like 5  
times a day should be ok (as long as you don’t have very long  
running requests).

Note though: if configuration will be reloaded automatically, it  
may be a good idea to somehow make sure it won’t happen in the  
middle of some manual edit of the config. As long as the config  
is invalid from syntax point of view, nginx will reject it and  
continue to work with an old configuration, but bad things might  
happen if the config is valid but just wrong.

Maxim D.
