• nginx 信号管理


    本内容只针对nginx 关闭操作罗列方法技巧,不废话直接写,Nginx的信号控制如下:


    1. TERM, INT 强制关闭进程

       查看nginx进程ps -aux|grep nginx
       root  8646  0.0  0.0  24844   768 ?  Ss 15:14  0:00 nginx: master process /usr/local/nginx/sbin/nginx
       nobody 8647  0.0  0.1  25256  1724 ?  S  15:14  0:00 nginx: worker process
       root   8674 0.0  0.0 112660 968 pts/3  R+   15:16   0:00 grep --color=auto nginx

       kill -INT  8646 表示强制关闭进程

     2. QUIT  优雅的关闭进程,即等请求结束后再关闭

      
        查看nginx进程ps -aux|grep nginx
        root  8646  0.0  0.0  24844   768 ?  Ss 15:14  0:00 nginx: master process /usr/local/nginx/sbin/nginx
        nobody 8647  0.0  0.1  25256  1724 ?  S  15:14  0:00 nginx: worker process
        root   8674 0.0  0.0 112660 968 pts/3  R+   15:16   0:00 grep --color=auto nginx

        kill -QUIT 8646  表示等请求结束后再关闭
     

     3. HUP 改变配置文件,平滑的重读配置文件

        查看nginx进程ps -aux|grep nginx
         root  8646  0.0  0.0  24844   768 ?  Ss 15:14  0:00 nginx: master process /usr/local/nginx/sbin/nginx
         nobody 8647  0.0  0.1  25256  1724 ?  S  15:14  0:00 nginx: worker process
         root   8674 0.0  0.0 112660 968 pts/3  R+   15:16   0:00 grep --color=auto nginx

         kill -HUP 8646  软重启,重加载文件

     4. USR1 重读日志

        查看nginx进程ps -aux|grep nginx
       root  8646  0.0  0.0  24844   768 ?  Ss 15:14  0:00 nginx: master process /usr/local/nginx/sbin/nginx
       nobody 8647  0.0  0.1  25256  1724 ?  S  15:14  0:00 nginx: worker process
       root   8674 0.0  0.0 112660 968 pts/3  R+   15:16   0:00 grep --color=auto nginx


             kill -USR1 8646  重读日志  

  • 相关阅读:
    给pdf文件添加防伪水印logo(附工程源码下载)
    关于正则,那些年一直存在的疑惑解答(正则菜鸟不容错过)
    那些年用过的一些前端框架
    优化Javascript数据遍历
    PHP5 mysqli 教程
    程序员一年工作经验之谈
    TCP协议的性能评测工具 — Tcpdive开源啦
    VMware Tools (ubuntu系统)安装详细过程与使用
    利用BBRSACryptor实现iOS端的RSA加解密
    Spring AOP详解(转载)
  • 原文地址:https://www.cnblogs.com/M87-A/p/11208265.html
Copyright © 2020-2023  润新知