#强制杀掉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. 【linux】linux中tree的安装

    # 2018/7/29 10:17:46测试成功! 一 Tree命令简介 tree是一种递归目录列表命令,产生一个深度缩进列表文件. 二 Tree命令安装 1.下载安装包,地址:http://mama ...

  2. 解析LINQ To Object

    1.解剖Linq to object   此文转载自http://www.cnblogs.com/irenebbkiss/p/4155480.html LINQ想必大家都不陌生了,它 的出现使得我们的 ...

  3. [C/C++] #ifdef和#endif

    一般情况下,源程序中所有的行都参加编译.但是有时希望对其中一部分内容只在满足一定条件才进行编译,也就是对一部分内容指定编译的条件,这就是“条件编译”.有时,希望当满足某条件时对一组语句进行编译,而当条 ...

  4. Hibernate技术入门

    ORM原理 ORM(Object Relational Mapping)是对象到关系的映射,它的作用是在关系数据库和对象之间做一个自动映射,将数据库中的数据表映射成对象(持久化类),对关系型数据库以对 ...

  5. [洛谷P4838]P哥破解密码

    题目大意:求长度为$n$的$01$串中,没有连续至少$3$个$1$的串的个数 题解:令$a_1$为结尾一个$1$的串个数,$a_2$为结尾两个$1$的串的个数,$b$为结尾是$0$的串的个数.$a_1 ...

  6. [国家集训队]Crash的数字表格 / JZPTAB 莫比乌斯反演

    ---题面--- 题解: $$ans = \sum_{i = 1}^{n}\sum_{j = 1}^{m}{\frac{ij}{gcd(i, j)}}$$ 改成枚举d(设n < m) $$ans ...

  7. NEYC 2017 游记

    day 1:  result:    sum_rank: 11   school_rank:1   水题在你高估的时候就已经不水了   sum:有个快速乘类似快速幂:       int ans=0; ...

  8. 关于Maven项目install时出现No compiler is provided in this environment的处理

    关于Maven项目build时出现No compiler is provided in this environment的处理 新配置的Eclipse环境,运行现有项目没问题,一日,从svn上检出了一 ...

  9. last_query_cost

    The total cost of the last compiled query as computed by the query optimizer. This is useful for com ...

  10. Eclipse来push,fetch,rebase代码

    如何与项目里的其他人一起合作项目,提交代码并更新呢?这里提出我比最近用到的两种工具:一种是Eclipse,另外一个是SourceTree.个人推荐从事Java开发的话,可以用Eclipse.当然,还有 ...