#强制杀掉Nginx
ps -ef|grep nginx|grep -v grep|awk '{print $2}'|xargs kill -9
rm -rf /usr/local/openresty/nginx/logs/nginx.pid

(1)如果进程中没有NGINX存在:
[root@huanghai conf]# ps -ef|grep nginx|grep -v grep|awk '{print $2}'|xargs kill -9
usage: kill [ -s signal | -p ] [ -a ] pid ...
       kill -l [ signal ]
(2)如果进程中有NGINX存在,那么无回显

#重启Nginx
service nginx restart && ps -ef | grep nginx

kill -9 杀不掉进程的原因
http://blog.csdn.net/u012349696/article/details/52250640

ps aux | grep nginx | grep -v grep

USER    PID   %CPU %MEM VSZ   RSS TTY    STAT   START TIME COMMAND
root       9562  0.0  0.0  52664  1344 ?        Ss   22:27   0:00 nginx: master process /usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf
nobody     9566  0.0  0.0  53036  1976 ?        S    22:27   0:00 nginx: worker process                                                              
nobody     9567  0.0  0.0  53036  2044 ?        S    22:27   0:00 nginx: worker process                                                              
nobody     9568  0.0  0.0  53036  2044 ?        S    22:27   0:00 nginx: worker process                                                              
nobody     9569  0.0  0.0  53036  2016 ?        S    22:27   0:00 nginx: worker process

D状态的进程是硬件资源不满足而处于深度休眠状态, 一般是等待磁盘. 这种进程用kill -9杀不掉, 要么继续等, 要么重启

stat 中的参数意义如下:
   D 不可中断 Uninterruptible(usually IO)
   R 正在运行,或在队列中的进程
   S 处于休眠状态
   T 停止或被追踪
   Z 僵尸进程
   W 进入内存交换(从内核2.6开始无效)
   X   死掉的进程

< 高优先级
    n   低优先级
    s   包含子进程
    +   位于后台的进程组

#查看io情况
yum install iotop -y
yum install sysstat -y

[root@huanghai ~]# iotop
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND                                                                        
    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
    2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
    3 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/0]
    4 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
    5 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [stopper/0]
    6 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [watchdog/0]
    7 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [events/0]
    8 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [events/0]
    9 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [events_long/0]
   10 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [events_power_ef]
   11 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [cgroup]
   12 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [khelper]
   13 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [netns]
   14 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [async/mgr]
   15 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [pm]
   16 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [sync_supers]
   17 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [bdi-default]
   18 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kintegrityd/0]

[root@huanghai ~]#ps -ef | grep nginx
root       1424      1  0 22:41 ?        00:00:00 nginx: master process /usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf
root       1427   1351  0 22:41 pts/0    00:00:00 grep nginx
nobody     1428   1424  0 22:41 ?        00:00:00 nginx: worker process                                                              
nobody     1429   1424  0 22:41 ?        00:00:00 nginx: worker process                                                              
nobody     1430   1424  0 22:41 ?        00:00:00 nginx: worker process                                                              
nobody     1431   1424  0 22:41 ?        00:00:00 nginx: worker process

先对一下时间:

ntpdate cn.ntp.org.cn

http://www.ntp.org.cn/

[root@huanghai ~]# pidstat -d -p 1424
Linux 2.6.32-696.el6.x86_64 (huanghai)  2017年08月26日  _x86_64_        (1 CPU)

22时41分27秒       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
22时41分27秒      1424      0.00      0.01      0.00  nginx

由此来测算NGINX的无响应情况下它的IO使用情况如何。

还有就是赤峰还需要进一步检查系统优化情况,打开文件数等参数是否设置正确。

赤峰项目Nginx进程异常的处理办法的更多相关文章

  1. Android native进程间通信实例-socket本地通信篇之——服务端进程异常退出解决办法

    导读: 好难受啊,为什么服务端说挂就挂,明明只是客户端关闭而已,服务端怎么能挂呢? 想想,如果手机上使用一个聊天程序的时候,手机端关闭了聊天程序,那么远端服务器程序总不能说挂就挂吧!所以一定要查明真相 ...

  2. 解决openoffice进程异常退出的办法

    步骤1 编写脚本 openoffice.sh #!/usr/bin/bash OPENOFFICEPID=`ps -ef|grep "/opt/openoffice4/program/sof ...

  3. 解决openoffice进程异常退出的办法:

    实现以守护进程,定时检测openoffice是否退出,如果进程不存在,通过脚本将openoffice起起来即可.   具体操作步骤: 第一步: 将openoffice.sh脚本放置在root目录下面, ...

  4. Nginx问题定位之监控进程异常退出

    nginx在运行过程中是否稳定,是否有异常退出过?这里总结几项平时会用到的小技巧. 1. 在error.log中查看是否有signal项,如果有,看看signal是多少. 比如,这是一个异常退出的情况 ...

  5. 如何实现Nginx+Keepalived中Nginx进程的高可用

    此架构我简单说明下: 一般为了维护方便,企业网站的服务器都在自己的内部机房里,只开放了Keepalived的VIP地址的两个端口80.443,通过Juniper SSG550防火墙映射出去,外网DNS ...

  6. Java-----关于eclipse导入项目发生的问题及解决办法

    今天通过eclipse导入了几个项目,项目名出现红叉,对于我这样的强迫症来说是无法容忍的,故现做总结,遇到同学可按照以下方法来操作. 改动的地方主要是两个方面: 1.Tomcat版本问题. 此问题是由 ...

  7. 【学习笔记】启动Nginx、查看nginx进程、查看nginx服务主进程的方式、Nginx服务可接受的信号、nginx帮助命令、Nginx平滑重启、Nginx服务器的升级

     1.启动nginx的方式: cd /usr/local/nginx ls ./nginx -c nginx.conf 2.查看nginx的进程方式: [root@localhost nginx] ...

  8. Address already in use: JVM_Bind:80 异常的解决办法

    java.net.BindException: Address already in use: JVM_Bind:80 异常的解决办法 今天遇见了这个端口被占用问题 然后各种百度 先是说 用命令 ne ...

  9. Tomcat异常及解决办法——持续更新中

    公司项目,开发语言为java,中间件为Tomcat,运行过程中,从Tomcat出现了一些异常,现将异常及解决办法记录如下,仅供参考.(不断在补充中.......) 异常一: 1.日志内容 org.ap ...

随机推荐

  1. hadoop 2.6.0 伪分布式部署安装遇到的问题

    之前读到了一篇关于配置安装hadoop的博文(地址:http://www.powerxing.com/install-hadoop/)能正确安装和运行,但是在网页进行Jobtracker监控时,输入l ...

  2. lintcode-76-最长上升子序列

    76-最长上升子序列 给定一个整数序列,找到最长上升子序列(LIS),返回LIS的长度. 说明 最长上升子序列的定义: 最长上升子序列问题是在一个无序的给定序列中找到一个尽可能长的由低到高排列的子序列 ...

  3. IO调度

    互联网公司不关注真实的文件系统,他们关注VFS层,关注block层,关注IO的管控. queue->make_request_fn ( blk_queue_bio ),其中blk_queue_b ...

  4. 【bzoj4002】[JLOI2015]有意义的字符串 数论+矩阵乘法

    题目描述 B 君有两个好朋友,他们叫宁宁和冉冉.有一天,冉冉遇到了一个有趣的题目:输入 b;d;n,求 输入 一行三个整数 b;d;n 输出 一行一个数表示模 7528443412579576937 ...

  5. JavaScript 操作选中当前的li元素并给他添加select类

    JavaScript 操作选中当前的li元素并给他添加select类.之前都是使用jquery写的,今天使用JavaScript写一个. <!DOCTYPE html> <html ...

  6. P2874 [USACO07FEB]新牛棚Building A New Barn

    题目描述 After scrimping and saving for years, Farmer John has decided to build a new barn. He wants the ...

  7. [BZOJ1283]序列

    Description 给出一个长度为n的正整数序列Ci,求一个子序列,使得原序列中任意长度为m的子串中被选出的元素不超过K(K,M<=100) 个,并且选出的元素之和最大. Input 第1行 ...

  8. 对C++ templates类模板的几点补充(Traits类模板特化)

    前一篇文章<浅谈C++ templates 函数模板.类模板以及非类型模板参数>简单的介绍了什么是函数模板(这个最简单),类模板以及非类型模板参数.本文对类模板再做几点补充. 文章目录1. ...

  9. How to turn off the binary log for mysqld_multi instances?

    Q: MySQL supports running multiple mysqld on the same server. One of the ways is to use mysqld_multi ...

  10. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) C

    C. Little Artem and Matrix time limit per test 2 seconds memory limit per test 256 megabytes input s ...