<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Hello Maxim! :o)<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 16, 2013 at 11:16 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<div class="im"><br>
On Fri, Aug 16, 2013 at 10:16:16PM -0400, B.R. wrote:<br>
<br>
> I guess it would be nice if the doc warned about directives that need a<br>
> server restart to be reloaded.<br>
><br>
> Everyone supposes (as it seems obvious) that reloading Nginx is enough to<br>
> apply configuration changes.<br>
<br>
</div>Reloading is enough. What is very wrong is to assume that sending<br>
a HUP signal to nginx is enough for a reload. For various<br>
reasons, ranging from configuration syntax errors to out of memory<br>
problems, configuration reload might fail.<br>
<br>
Quoting documentation:<br>
<br>
... If this fails, it rolls back changes and continues to work<br>
with old configuration. ...<br>
<br>
<a href="http://nginx.org/en/docs/control.html#reconfiguration" target="_blank">http://nginx.org/en/docs/control.html#reconfiguration</a><br></blockquote><div><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">
Yup I knew that. I thought Nginx was able to re-arrange its memory allocation for the new variable.<br>I didn't know it was keeping the same fixed memory, only replacing existing values.<br><br>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.<br>
That would be a nice improvement to the init script shipped with the official Nginx package (from <a href="http://nginx.org">nginx.org</a>) to avoid a manual 'nginx -t' call before the reload.<br></div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> An interesting part of the question was the inquiry about the potential<br><div class="im">
> existence other directives requiring a server restart rather than its<br>
> reload. Do you have intel on this Maxim?<br>
<br>
</div>There are no directives which require a server restart. But some<br>
changes are not possible on the fly - e.g. you can't change a<br>
shared memory zone size. If you want to change it - you have to<br>
create another shared memory zone, or use a binary upgrade which<br>
doesn't inherit shared memory zones and their contents (or use a<br>
restart, which will obviously work as well).<br></blockquote><div><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">That reminds me that the init script shipped with Nginx doesn't take advantage of the 'hot binary switch'<br>
<br>to provide a 'soft restart' without downtime.<br>It clearly would be a nice alternative to the normal restart which is basically a stop/start.<br><br>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.<br>
</div></div></div><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font>
</div></div>