免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: gnubuntu
打印 上一主题 下一主题

[Web] nginx运行出现cpu us+sy 100% id 0的情况,网站访问不了 [复制链接]

论坛徽章:
0
1 [报告]
发表于 2010-03-31 17:10 |显示全部楼层
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
看下状态

论坛徽章:
0
2 [报告]
发表于 2010-03-31 17:12 |显示全部楼层
就是nginx吃的cpu么?

论坛徽章:
0
3 [报告]
发表于 2010-03-31 17:14 |显示全部楼层
CPU
       These are percentages of total CPU time.
       us: Time spent running non-kernel code. (user time, including nice time)
       sy: Time spent running kernel code. (system time)
       id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
       wa: Time spent waiting for IO. Prior to Linux 2.5.41, shown as zero.

论坛徽章:
0
4 [报告]
发表于 2010-03-31 17:45 |显示全部楼层
和那个是一个帖子吧 可以下面操作后看看。
看下你的ulimit估计是不够用了
# vi /etc/sysctl.conf
底部添加
fs.file-max=65535
#vi /etc/security/limits.conf
加上
* soft nofile 65535
* hard nofile 65535

启动Nginx
ulimit -SHn 65535
/usr/local/nginx/sbin/nginx

配置开机自动启动Nginx + PHP
vi /etc/rc.local

  在末尾增加以下内容:
引用
ulimit -SHn 65535
/usr/local/php/sbin/php-fpm start
/usr/local/nginx/sbin/nginx

论坛徽章:
0
5 [报告]
发表于 2010-03-31 17:54 |显示全部楼层
回复  xuledw


    TCP状态异常,是ESTABLISHED超少
gnubuntu 发表于 2010-03-31 17:49



    超少 不代表是异常,网站访问量大么?
# ulimit -n
看看是多少
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP