Nginx reload problem
B.R.
reallfqq-nginx at yahoo.fr
Sat Aug 17 04:07:22 UTC 2013
Hello Maxim! :o)
On Fri, Aug 16, 2013 at 11:16 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> Hello!
>
> On Fri, Aug 16, 2013 at 10:16:16PM -0400, B.R. wrote:
>
> > I guess it would be nice if the doc warned about directives that need a
> > server restart to be reloaded.
> >
> > Everyone supposes (as it seems obvious) that reloading Nginx is enough to
> > apply configuration changes.
>
> Reloading is enough. What is very wrong is to assume that sending
> a HUP signal to nginx is enough for a reload. For various
> reasons, ranging from configuration syntax errors to out of memory
> problems, configuration reload might fail.
>
> Quoting documentation:
>
> ... If this fails, it rolls back changes and continues to work
> with old configuration. ...
>
> http://nginx.org/en/docs/control.html#reconfiguration
>
Yup I knew that. I thought Nginx was able to re-arrange its memory
allocation for the new variable.
I didn't know it was keeping the same fixed memory, only replacing
existing values.
I saw on some init script on CentOS (probably with the packaged version of
that OS) that the configuration check was invoked automatically when the
service reload was called.
That would be a nice improvement to the init script shipped with the
official Nginx package (from nginx.org) to avoid a manual 'nginx -t' call
before the reload.
> > An interesting part of the question was the inquiry about the potential
> > existence other directives requiring a server restart rather than its
> > reload. Do you have intel on this Maxim?
>
> There are no directives which require a server restart. But some
> changes are not possible on the fly - e.g. you can't change a
> shared memory zone size. If you want to change it - you have to
> create another shared memory zone, or use a binary upgrade which
> doesn't inherit shared memory zones and their contents (or use a
> restart, which will obviously work as well).
>
That reminds me that the init script shipped with Nginx doesn't take
advantage of the 'hot binary switch'
to provide a 'soft restart' without downtime.
It clearly would be a nice alternative to the normal restart which is
basically a stop/start.
Thanks for your answer and your involvement on the mailing list btw. Your
team job interfacing with us makes Nginx a product with an added reassuring
sensation of quality & comfort.
---
*B. R.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130817/814c3f92/attachment-0001.html>
More information about the nginx
mailing list