全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 3197|回复: 19
打印 上一主题 下一主题

[疑问] 求助 apache搞坏了 进程不会结束

[复制链接]
跳转到指定楼层
1#
发表于 2011-3-11 09:51:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
不知道怎么搞的
apache进程不会结束了
服务器现在没有访客 可以看cpu是99.9%idle 但系统占用真实内存2.30 GB 虚拟内存527.45 MB
若是开放访客会占内存到100% 系统负载会不断升高到当机 像进了无穷回圈一样打结
有人知道怎么会这样吗?
  1. top - 19:46:28 up  9:07,  1 user,  load average: 0.06, 0.08, 0.08
  2. Tasks: 164 total,   1 running, 163 sleeping,   0 stopped,   0 zombie
  3. Cpu(s):  0.0%us,  0.1%sy,  0.0%ni, 99.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
  4. Mem:   3970216k total,  2603940k used,  1366276k free,    21576k buffers
  5. Swap:  2104504k total,   540108k used,  1564396k free,   211992k cached
  6. Maximum tasks = 0, change to (0 is unlimited):
  7.   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                           
  8. 2899 mysql     15   0  853m  20m 3084 S  0.0  0.5  14:51.34 mysqld                                                                             
  9. 3039 apache    15   0  367m  48m 3968 S  0.0  1.3   1:38.04 httpd                                                                              
  10. 3273 apache    15   0  367m  48m 3916 S  0.0  1.2   1:33.76 httpd                                                                              
  11. 3078 apache    15   0  387m  57m 3816 S  0.0  1.5   1:32.97 httpd                                                                              
  12. 3041 apache    15   0  369m  48m 4888 S  0.0  1.2   1:26.65 httpd                                                                              
  13. 3283 apache    15   0  370m  49m 4980 S  0.0  1.3   1:24.58 httpd                                                                              
  14. 3279 apache    15   0  367m  47m 3816 S  0.0  1.2   1:22.63 httpd                                                                              
  15. 3469 apache    15   0  367m  48m 3916 S  0.0  1.2   1:22.59 httpd                                                                              
  16. 17418 apache    15   0  387m  58m 3908 S  0.0  1.5   0:31.10 httpd                                                                              
  17. 18423 apache    15   0  391m  60m 4876 S  0.0  1.6   0:29.67 httpd                                                                              
  18. 17404 apache    15   0  367m  48m 3876 S  0.0  1.2   0:29.06 httpd                                                                              
  19. 17495 apache    15   0  367m  48m 3848 S  0.0  1.2   0:28.89 httpd                                                                              
  20. 17886 apache    15   0  367m  47m 3780 S  0.0  1.2   0:28.59 httpd                                                                              
  21. 18528 apache    15   0  367m  47m 3752 S  0.0  1.2   0:25.05 httpd                                                                              
  22. 17505 apache    15   0  369m  46m 4760 S  0.0  1.2   0:23.64 httpd                                                                              
  23. 18530 apache    15   0  367m  46m 3792 S  0.0  1.2   0:23.49 httpd                                                                              
  24. 19367 apache    15   0  367m  48m 3752 S  0.0  1.2   0:22.67 httpd                                                                              
  25. 18831 apache    15   0  369m  44m 5424 S  0.0  1.2   0:22.11 httpd                                                                              
  26. 19368 apache    15   0  367m  47m 3796 S  0.0  1.2   0:21.69 httpd
复制代码
2#
发表于 2011-3-11 09:58:33 | 只看该作者
看配置文件
3#
 楼主| 发表于 2011-3-11 10:07:37 | 只看该作者
我改过的Apache参数

Maximum requests per server process          8000
           Maximum spare server processes          50
Minimum spare server processes         5
        Initial server processes         8

KeepAlive On
MaxKeepAliveRequests 500
4#
 楼主| 发表于 2011-3-11 10:11:27 | 只看该作者
我改过的PHP参数
PHP script execution mode          Apache mod_php (run as Apache's user)
Maximum PHP script run time         600   seconds

Maximum memory allocation         256M
          Maximum HTTP POST size         100M
Maximum file upload size         50M
        Maximum execution time         600    seconds
Maximum input parsing time          600    seconds
5#
 楼主| 发表于 2011-3-11 10:52:35 | 只看该作者
明明没半个访客
  1. [root@wwwserver ~]# netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
  2. TIME_WAIT 8
  3. ESTABLISHED 1
复制代码
但Apache就是一直在执行
  1. [root@wwwserver ~]# ps aux
  2. USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
  3. apache    3273  0.2  1.2 376360 50568 ?        S    10:40   1:38 /usr/sbin/httpd
  4. apache    3279  0.2  1.2 376360 50968 ?        S    10:41   1:27 /usr/sbin/httpd
  5. apache    3283  0.2  1.3 379452 52384 ?        S    10:41   1:28 /usr/sbin/httpd
  6. apache    3469  0.2  1.2 376360 50128 ?        S    10:44   1:27 /usr/sbin/httpd
  7. apache   17404  0.2  1.2 376360 51164 ?        S    17:43   0:33 /usr/sbin/httpd
  8. apache   17418  0.3  1.5 396840 60084 ?        S    17:43   0:37 /usr/sbin/httpd
  9. apache   17495  0.2  1.2 376360 50812 ?        S    17:44   0:33 /usr/sbin/httpd
  10. apache   17505  0.2  1.2 378428 50436 ?        S    17:44   0:29 /usr/sbin/httpd
  11. apache   17886  0.3  1.2 376360 50808 ?        S    17:49   0:33 /usr/sbin/httpd
  12. apache   18423  0.3  1.5 401088 62348 ?        S    17:54   0:34 /usr/sbin/httpd
  13. apache   18528  0.2  1.2 376360 50432 ?        S    17:55   0:30 /usr/sbin/httpd
  14. apache   18530  0.2  1.2 376360 49696 ?        S    17:55   0:29 /usr/sbin/httpd
  15. apache   18830  0.2  1.2 376360 49676 ?        S    17:58   0:23 /usr/sbin/httpd
  16. apache   18831  0.2  1.1 378428 45732 ?        S    17:58   0:26 /usr/sbin/httpd
  17. apache   19361  0.1  1.2 378428 49992 ?        S    18:03   0:20 /usr/sbin/httpd
  18. apache   19367  0.2  1.2 376360 50272 ?        S    18:03   0:27 /usr/sbin/httpd
  19. apache   19368  0.2  1.2 376360 49856 ?        S    18:03   0:24 /usr/sbin/httpd
  20. apache   19788  0.2  1.2 376360 50948 ?        S    18:07   0:21 /usr/sbin/httpd
  21. apache   20025  0.2  1.2 376360 49200 ?        S    18:09   0:22 /usr/sbin/httpd
  22. apache   20322  0.1  1.2 376360 50216 ?        S    18:12   0:18 /usr/sbin/httpd
  23. apache   21366  0.1  1.2 376360 49764 ?        S    18:21   0:14 /usr/sbin/httpd
  24. apache   21367  0.1  1.2 376360 50000 ?        S    18:21   0:15 /usr/sbin/httpd
  25. apache   21662  0.1  1.2 376360 50676 ?        S    18:23   0:15 /usr/sbin/httpd
  26. apache   22001  0.1  1.2 376360 50516 ?        S    18:26   0:15 /usr/sbin/httpd
  27. apache   22007  0.1  1.3 376360 51676 ?        S    18:26   0:14 /usr/sbin/httpd
  28. apache   22010  0.1  1.2 376360 50176 ?        S    18:26   0:13 /usr/sbin/httpd
  29. apache   22013  0.1  1.2 376360 50876 ?        S    18:26   0:15 /usr/sbin/httpd
  30. apache   22015  0.1  1.2 376360 50468 ?        S    18:26   0:14 /usr/sbin/httpd
  31. apache   22066  0.1  1.2 376360 51080 ?        S    18:27   0:15 /usr/sbin/httpd
  32. apache   22071  0.1  1.2 376360 51116 ?        S    18:27   0:14 /usr/sbin/httpd
  33. apache   22077  0.1  1.3 376360 51712 ?        S    18:27   0:14 /usr/sbin/httpd
  34. apache   22080  0.1  1.2 376360 49436 ?        S    18:27   0:14 /usr/sbin/httpd
  35. apache   22081  0.1  1.2 376360 50636 ?        S    18:27   0:13 /usr/sbin/httpd
  36. apache   22082  0.1  1.2 376360 50800 ?        S    18:27   0:13 /usr/sbin/httpd
  37. apache   22083  0.1  1.2 376360 50396 ?        S    18:27   0:13 /usr/sbin/httpd
  38. apache   22385  0.1  1.2 376360 50080 ?        S    18:29   0:12 /usr/sbin/httpd
  39. apache   22391  0.1  1.2 376360 50936 ?        S    18:29   0:12 /usr/sbin/httpd
  40. apache   22392  0.1  1.2 376360 51152 ?        S    18:29   0:15 /usr/sbin/httpd
  41. apache   22393  0.1  1.2 376360 50132 ?        S    18:29   0:12 /usr/sbin/httpd
  42. apache   22394  0.1  1.2 376360 49904 ?        S    18:29   0:12 /usr/sbin/httpd
  43. apache   22413  0.1  1.2 376360 49852 ?        S    18:29   0:11 /usr/sbin/httpd
  44. apache   22553  0.1  1.2 376360 50588 ?        S    18:30   0:12 /usr/sbin/httpd
  45. apache   22555  0.1  1.3 376360 51860 ?        S    18:30   0:13 /usr/sbin/httpd
  46. apache   22556  0.1  1.2 376360 50796 ?        S    18:30   0:12 /usr/sbin/httpd
  47. apache   22561  0.1  1.2 376360 49880 ?        S    18:30   0:13 /usr/sbin/httpd
  48. apache   22563  0.1  1.2 376360 50712 ?        S    18:30   0:11 /usr/sbin/httpd
  49. apache   22564  0.1  1.2 376360 50828 ?        S    18:30   0:13 /usr/sbin/httpd
复制代码
6#
发表于 2011-3-11 10:57:12 | 只看该作者
小内存的机必须限制进程数,不然访问量一多,内存会暴的
7#
 楼主| 发表于 2011-3-11 11:01:46 | 只看该作者
我是放在独服上
Processor        3.06GHz i3 540
Real memory         3.79 GB total, 2.36 GB used
Virtual memory         2.01 GB total, 527.33 MB used
8#
发表于 2011-3-11 13:33:03 | 只看该作者
killall -9 httpd
9#
发表于 2011-3-11 13:45:23 | 只看该作者
配置不懂就不要乱改
10#
发表于 2011-3-11 13:59:56 | 只看该作者
修改httpd-mpm文件,

maxclient不要太大。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-10-31 12:31 , Processed in 0.062302 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表