免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5397 | 回复: 7
打印 上一主题 下一主题

[服务应用] CentOS 5.8 64位 CPU占用高,频繁死机 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-12-04 10:13 |只看该作者 |倒序浏览
新安装了一台服务器,CPU Xeon E31230,内存16G,网站开通后,CPU使用率一直在90%以上,负载能有30左右,运行几个小时以后服务器就死机
不知道是什么原因导致CPU占用高

环境:CentOS 5.8, Apache 2.2.22,  MySQL 5.2.58 ,PHP 5.2.17
Apache 配置
  1. <IfModule prefork.c>
  2. StartServers       8
  3. MinSpareServers    5
  4. MaxSpareServers   20
  5. ServerLimit      1500
  6. MaxClients       1000
  7. MaxRequestsPerChild  1000
  8. </IfModule>
复制代码
错误日志
  1. [warn] child process 7708 still did not exit, sending a SIGTERM
  2. [warn] child process 7711 still did not exit, sending a SIGTERM
  3. [warn] child process 7714 still did not exit, sending a SIGTERM
  4. [warn] child process 7728 still did not exit, sending a SIGTERM
  5. [warn] child process 7729 still did not exit, sending a SIGTERM
  6. [warn] child process 7732 still did not exit, sending a SIGTERM
  7. [warn] child process 7801 still did not exit, sending a SIGTERM
  8. [warn] child process 7966 still did not exit, sending a SIGTERM
  9. [warn] child process 7708 still did not exit, sending a SIGTERM
  10. [warn] child process 7711 still did not exit, sending a SIGTERM
  11. [warn] child process 7714 still did not exit, sending a SIGTERM
  12. [warn] child process 7728 still did not exit, sending a SIGTERM
  13. [warn] child process 7729 still did not exit, sending a SIGTERM
  14. [warn] child process 7732 still did not exit, sending a SIGTERM
  15. [warn] child process 7801 still did not exit, sending a SIGTERM
  16. [warn] child process 7966 still did not exit, sending a SIGTERM
  17. [warn] child process 7708 still did not exit, sending a SIGTERM
  18. [warn] child process 7711 still did not exit, sending a SIGTERM
  19. [warn] child process 7714 still did not exit, sending a SIGTERM
  20. [warn] child process 7728 still did not exit, sending a SIGTERM
  21. [warn] child process 7729 still did not exit, sending a SIGTERM
  22. [warn] child process 7732 still did not exit, sending a SIGTERM
  23. [warn] child process 7801 still did not exit, sending a SIGTERM
  24. [warn] child process 7966 still did not exit, sending a SIGTERM
  25. [error] child process 7708 still did not exit, sending a SIGKILL
  26. [error] child process 7711 still did not exit, sending a SIGKILL
  27. [error] child process 7714 still did not exit, sending a SIGKILL
  28. [error] child process 7728 still did not exit, sending a SIGKILL
  29. [error] child process 7729 still did not exit, sending a SIGKILL
  30. [error] child process 7732 still did not exit, sending a SIGKILL
  31. [error] child process 7966 still did not exit, sending a SIGKILL
  32. [notice] caught SIGTERM, shutting down
  33. [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
  34. [notice] Digest: generating secret for digest authentication ...
  35. [notice] Digest: done
  36. [notice] Apache/2.2.22 (Unix) DAV/2 PHP/5.2.17 configured -- resuming normal operations
复制代码

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
2 [报告]
发表于 2012-12-04 23:07 |只看该作者
在高的时候, 谁占了 CPU 呢 ?

论坛徽章:
0
3 [报告]
发表于 2012-12-05 09:06 |只看该作者
Apache 好几个线程占用率都在70%以上回复 2# q1208c


   

论坛徽章:
2
狮子座
日期:2014-01-02 10:47:24丑牛
日期:2014-02-13 17:58:37
4 [报告]
发表于 2012-12-05 09:57 |只看该作者
回复 1# loopool
  1. <IfModule prefork.c>
  2. StartServers       8
  3. MinSpareServers    5
  4. MaxSpareServers   20
  5. ServerLimit      1500
  6. MaxClients       1000
  7. MaxRequestsPerChild  0
  8. </IfModule>
复制代码
试试这个apache 的prefork.c参数

改系统应用用户文件描述符:
#ulimit -SHn 20480

论坛徽章:
0
5 [报告]
发表于 2012-12-06 13:53 |只看该作者
本帖最后由 loopool 于 2012-12-06 13:55 编辑

最大文件打开数之前已经改为65565
MaxRequestsPerChild 设为0,不会存在内存泄露的问题吗?回复 4# vincent_lnfsddy


   

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
6 [报告]
发表于 2012-12-06 14:48 |只看该作者
回复 3# loopool


你的 apache上是不是有什么 mod ?

正常情况下, apache不应该占太多的 CPU 的.

论坛徽章:
0
7 [报告]
发表于 2012-12-07 08:49 |只看该作者
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

没有多余的mod吧
回复 6# q1208c


   

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
8 [报告]
发表于 2012-12-07 18:47 |只看该作者
回复 7# loopool

这些是静态编译进去的, 不是动态加载的. 你要看一下你动态加载的 mod. 如果只有这些, 是不该导致占CPU很高的.
   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP