<div dir="ltr">Hi,<div><br></div><div>I am maintaining a custom module for nginx. We currently rotate our logs and load dynamic data every 5 minutes by using SIGHUP. Unfortunately this is also tears down our keepalive connections which harms our performance (we are handling about 1500 requests per second per server). We have a number of custom log files in addition to the access log and error log which also need to be rotated.</div>
<div><br></div><div>I was hoping that I could use SIGUSR1 to reopen the logs (including the module's custom logs) and notify the module that it should reload the dynamic data without dropping the keepalive connections.</div>
<div><br></div><div>I can see that I could use ngx_conf_open_file() to open the module's custom log files so that nginx will take care of reopening them. However for reloading the dynamic data: I can't see a way to hook the SIGUSR1 in the worker process (which shows up as a NGX_CMD_REOPEN in the channel for the worker process). However if I added a new hook for NGX_CMD_REOPEN then epoll inside the channel handler would probably return EEXIST.</div>
<div><br></div><div>So what is the best way for a module to hook NGX_CMD_REOPEN? Or is there better way of approaching this?</div><div><br></div><div>-Andrew</div><div><br></div><div><br></div></div>

<br>
<div><font size="1">NOTICE</font></div><div><font size="1"><br></font></div><div><font size="1">This e-mail and any attachments are confidential and may contain copyright material of Brandscreen or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Brandscreen does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Brandscreen.</font></div><div style="font-size:1.3em"><br></div>