赤峰项目Nginx进程异常的处理办法
#强制杀掉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
[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进程异常的处理办法的更多相关文章
- Android native进程间通信实例-socket本地通信篇之——服务端进程异常退出解决办法
导读: 好难受啊,为什么服务端说挂就挂,明明只是客户端关闭而已,服务端怎么能挂呢? 想想,如果手机上使用一个聊天程序的时候,手机端关闭了聊天程序,那么远端服务器程序总不能说挂就挂吧!所以一定要查明真相 ...
- 解决openoffice进程异常退出的办法
步骤1 编写脚本 openoffice.sh #!/usr/bin/bash OPENOFFICEPID=`ps -ef|grep "/opt/openoffice4/program/sof ...
- 解决openoffice进程异常退出的办法:
实现以守护进程,定时检测openoffice是否退出,如果进程不存在,通过脚本将openoffice起起来即可. 具体操作步骤: 第一步: 将openoffice.sh脚本放置在root目录下面, ...
- Nginx问题定位之监控进程异常退出
nginx在运行过程中是否稳定,是否有异常退出过?这里总结几项平时会用到的小技巧. 1. 在error.log中查看是否有signal项,如果有,看看signal是多少. 比如,这是一个异常退出的情况 ...
- 如何实现Nginx+Keepalived中Nginx进程的高可用
此架构我简单说明下: 一般为了维护方便,企业网站的服务器都在自己的内部机房里,只开放了Keepalived的VIP地址的两个端口80.443,通过Juniper SSG550防火墙映射出去,外网DNS ...
- Java-----关于eclipse导入项目发生的问题及解决办法
今天通过eclipse导入了几个项目,项目名出现红叉,对于我这样的强迫症来说是无法容忍的,故现做总结,遇到同学可按照以下方法来操作. 改动的地方主要是两个方面: 1.Tomcat版本问题. 此问题是由 ...
- 【学习笔记】启动Nginx、查看nginx进程、查看nginx服务主进程的方式、Nginx服务可接受的信号、nginx帮助命令、Nginx平滑重启、Nginx服务器的升级
1.启动nginx的方式: cd /usr/local/nginx ls ./nginx -c nginx.conf 2.查看nginx的进程方式: [root@localhost nginx] ...
- Address already in use: JVM_Bind:80 异常的解决办法
java.net.BindException: Address already in use: JVM_Bind:80 异常的解决办法 今天遇见了这个端口被占用问题 然后各种百度 先是说 用命令 ne ...
- Tomcat异常及解决办法——持续更新中
公司项目,开发语言为java,中间件为Tomcat,运行过程中,从Tomcat出现了一些异常,现将异常及解决办法记录如下,仅供参考.(不断在补充中.......) 异常一: 1.日志内容 org.ap ...
随机推荐
- ASP.NET程序中设置相对路径的方法
如图所示,这是个绝对路径. 改为相对路径的方法是:AppDomain.CurrentDomain.BaseDirectory. 如下图所示:
- HL7 2.6 解析(XML)
用途:检验化验(LIS)实验室设备数据交换解析. using System; using System.Collections.Generic; using System.Text; using Sy ...
- tomcat 路径"/"表示根目录
- C#判断字符串是否为数字字符串
在进行C#编程时候,有的时候我们需要判断一个字符串是否是数字字符串,我们可以通过以下两种方法来实现.[方法一]:使用 try{} catch{} 语句. 我们可以在try语句块中试图将str ...
- 【题解】HEOI2013Eden 的新背包问题
这题真的神奇了……蜜汁复杂度(`・ω・´) 应该是一个比较连贯的思维方式:去掉一个物品,那么我们转移的时候不考虑它就好了呗.考虑暴力:每一次都对剩余的n - 1个物品进行多重背包转移,获得答案.既然可 ...
- Contest Hunter 模拟赛09 A [线段树维护斜率]
题面 传送门 思路 首先看看我们到底要干什么:有$1e6$次询问,遍历$i$,每次要求一个形如$b_i \ast a_j - a_i \ast b_j$的东西的最大值 考虑如果一个$j$的决策在当前的 ...
- jsp电子商务 购物车实现之二 登录和分页篇
登录页面核心代码 <div id="login"> <h2>用户登陆</h2> <form method="post" ...
- yaf的安装
http://kenby.iteye.com/blog/1979899 yaf源码分析学习网站 # wget https://github.com/laruence/php-yaf/archive/m ...
- [poj 3281]最大流+建图很巧妙
题目链接:http://poj.org/problem?id=3281 看了kuangbin大佬的思路,还用着kuangbin板子orz http://www.cnblogs.com/kuangb ...
- gitlab7.2安装
系统:centos6.4 1.安装依赖包 导入epel: useradd git wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-rel ...