zoukankan      html  css  js  c++  java
  • 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  重读日志  

  • 相关阅读:
    GCD多线程使用
    高德地图引入库错误std::string::find_first_of(char const*, unsigned long, unsigned long) const"
    vim配置 高亮+自动缩进+行号+折叠+优化
    设置MAC 下 Vim 语法高亮显示
    The platform of the target `Pods` (iOS 4.3) is not compatible 错误
    使用GCD创建单例
    使用Draw rect 绘制圆角矩形
    使用第三方类、库需要注意的正则类RegexKitLite的使用
    NSDate 时区转换问题
    UISlider设置按钮透明
  • 原文地址:https://www.cnblogs.com/M87-A/p/11208265.html
Copyright © 2011-2022 走看看