Suggestions on scaling with nginx

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:
http://forum.nginx.org/read.php?2,229028,229028#msg-229028

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

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.