Nginx multi-process model implementation details analysis

Foreword: “ Server programs usually control the work of the server through corresponding configuration files. In many cases, the configuration file will be modified frequently. When making it take effect, we hope that the program will not be restarted and the normal service of the server will not be affected. So the so-called “hot loading” of configuration files has become a very important function, and in this regard, nginx has set a very good example for us, which is worth learning and learning from. analyze: “ When nginx is in normal service, we execute ./nginx in the program directory of nginx ?sreload, to reload the configuration file. The function of -s is to send a signal to the master process. In addition to the reload function, stop, reopen, etc. can also be used. Specifically, you can view it through -h. When executing ./nginx ?s After reload, save the “reload” string through ngxs_signal, and then pass it through ngx_signal_process To send a signal to the currently running nginxmaster process. if (ngx_signal) { “ return ngx_signal_process(cycle, ngx_signal); } By reading the code, we can see that sending a signal to the currently running nginx process is actually restarting a copy of nginx,…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索