首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

Apache假死,Apache维护,多谢

2012-04-08 
Apache假死,Apache维护,高手请进,谢谢前几天,Apache还是每隔1天死一次,我一直在尝试解决,可这两天,每隔一

Apache假死,Apache维护,高手请进,谢谢
前几天,Apache还是每隔1天死一次,我一直在尝试解决,可这两天,每隔一个小时就死一次,如果在他死后,我不在进程中手动结束掉httpd.exe,便会出现下面的log:

HTML code
......[Sun Aug 16 09:20:45 2009] [notice] Parent: child process exited with status 1 -- Restarting.[Sun Aug 16 09:20:45 2009] [notice] Apache/2.2.4 (Win32) configured -- resuming normal operations[Sun Aug 16 09:20:45 2009] [notice] Server built: Jan  9 2007 23:17:20[Sun Aug 16 09:20:45 2009] [notice] Parent: Created child process 176[Sun Aug 16 09:20:45 2009] [notice] Child 176: Child process is running[Sun Aug 16 09:20:45 2009] [notice] Child 176: Acquired the start mutex.[Sun Aug 16 09:20:45 2009] [notice] Child 176: Starting 64 worker threads.[Sun Aug 16 09:20:45 2009] [notice] Child 176: Starting thread to listen on port 80.[Sun Aug 16 09:22:42 2009] [notice] Parent: Received restart signal -- Restarting the server.[Sun Aug 16 09:22:42 2009] [notice] Child 176: Exit event signaled. Child process is ending.[Sun Aug 16 09:22:43 2009] [notice] Apache/2.2.4 (Win32) configured -- resuming normal operations[Sun Aug 16 09:22:43 2009] [notice] Server built: Jan  9 2007 23:17:20[Sun Aug 16 09:22:43 2009] [notice] Parent: Created child process 948[Sun Aug 16 09:22:43 2009] [warn] (OS 10038)在一个非套接字上尝试了一个操作。  : setsockopt(SO_UPDATE_ACCEPT_CONTEXT) failed.[Sun Aug 16 09:22:43 2009] [notice] Child 948: Child process is running[Sun Aug 16 09:22:43 2009] [notice] Child 176: Released the start mutex[Sun Aug 16 09:22:43 2009] [notice] Child 948: Acquired the start mutex.[Sun Aug 16 09:22:43 2009] [notice] Child 948: Starting 64 worker threads.[Sun Aug 16 09:22:43 2009] [notice] Child 948: Starting thread to listen on port 80.[Sun Aug 16 09:22:44 2009] [notice] Child 176: Waiting for 64 worker threads to exit.[Sun Aug 16 09:22:44 2009] [notice] Child 176: All worker threads have exited.[Sun Aug 16 09:22:44 2009] [notice] Child 176: Child process is exiting[Sun Aug 16 09:23:52 2009] [notice] Parent: Received restart signal -- Restarting the server.[Sun Aug 16 09:23:52 2009] [notice] Child 948: Exit event signaled. Child process is ending.[Sun Aug 16 09:23:53 2009] [notice] Apache/2.2.4 (Win32) configured -- resuming normal operations[Sun Aug 16 09:23:53 2009] [notice] Server built: Jan  9 2007 23:17:20[Sun Aug 16 09:23:53 2009] [notice] Parent: Created child process 2976[Sun Aug 16 09:23:53 2009] [notice] Child 2976: Child process is running[Sun Aug 16 09:23:53 2009] [warn] (OS 10038)在一个非套接字上尝试了一个操作。  : setsockopt(SO_UPDATE_ACCEPT_CONTEXT) failed.[Sun Aug 16 09:23:53 2009] [notice] Child 948: Released the start mutex[Sun Aug 16 09:23:53 2009] [notice] Child 2976: Acquired the start mutex.[Sun Aug 16 09:23:53 2009] [notice] Child 2976: Starting 64 worker threads.[Sun Aug 16 09:23:53 2009] [notice] Child 2976: Starting thread to listen on port 80.[Sun Aug 16 09:23:54 2009] [notice] Child 948: Waiting for 64 worker threads to exit.[Sun Aug 16 09:23:54 2009] [notice] Child 948: All worker threads have exited.[Sun Aug 16 09:23:54 2009] [notice] Child 948: Child process is exiting[Sun Aug 16 09:47:42 2009] [notice] Parent: Received restart signal -- Restarting the server.[Sun Aug 16 09:47:42 2009] [notice] Child 2976: Exit event signaled. Child process is ending.[Sun Aug 16 09:47:42 2009] [warn] (OS 10038)在一个非套接字上尝试了一个操作。  : setsockopt(SO_UPDATE_ACCEPT_CONTEXT) failed.[Sun Aug 16 09:47:42 2009] [notice] Apache/2.2.4 (Win32) configured -- resuming normal operations[Sun Aug 16 09:47:42 2009] [notice] Server built: Jan  9 2007 23:17:20[Sun Aug 16 09:47:42 2009] [notice] Parent: Created child process 1776[Sun Aug 16 09:47:43 2009] [notice] Child 1776: Child process is running[Sun Aug 16 09:47:43 2009] [notice] Child 2976: Released the start mutex[Sun Aug 16 09:47:43 2009] [notice] Child 1776: Acquired the start mutex.[Sun Aug 16 09:47:43 2009] [notice] Child 1776: Starting 64 worker threads.[Sun Aug 16 09:47:43 2009] [notice] Child 1776: Starting thread to listen on port 80.[Sun Aug 16 09:47:44 2009] [notice] Child 2976: Waiting for 64 worker threads to exit.[Sun Aug 16 09:47:44 2009] [notice] Child 2976: All worker threads have exited.[Sun Aug 16 09:47:44 2009] [notice] Child 2976: Child process is exiting[Sun Aug 16 10:40:44 2009] [notice] Parent: child process exited with status 1 -- Restarting.[Sun Aug 16 10:40:45 2009] [notice] Apache/2.2.4 (Win32) configured -- resuming normal operations[Sun Aug 16 10:40:45 2009] [notice] Server built: Jan  9 2007 23:17:20[Sun Aug 16 10:40:45 2009] [notice] Parent: Created child process 632[Sun Aug 16 10:40:45 2009] [notice] Child 632: Child process is running[Sun Aug 16 10:40:45 2009] [notice] Child 632: Acquired the start mutex.[Sun Aug 16 10:40:45 2009] [notice] Child 632: Starting 64 worker threads.[Sun Aug 16 10:40:45 2009] [notice] Child 632: Starting thread to listen on port 80..... 


如果在他死后,我立马手动结束掉httpd.exe进程,就会出现下面类似的log:
HTML code
......[Sun Aug 16 12:53:51 2009] [notice] Parent: child process exited with status 3221225477 -- Restarting.[Sun Aug 16 12:53:51 2009] [notice] Apache/2.2.4 (Win32) configured -- resuming normal operations[Sun Aug 16 12:53:51 2009] [notice] Server built: Jan  9 2007 23:17:20[Sun Aug 16 12:53:51 2009] [notice] Parent: Created child process 3300[Sun Aug 16 12:53:52 2009] [notice] Child 3300: Child process is running[Sun Aug 16 12:53:52 2009] [notice] Child 3300: Acquired the start mutex.[Sun Aug 16 12:53:52 2009] [notice] Child 3300: Starting 64 worker threads.[h:1

我知道是Apache优化的问题,但我一直在改那些参数,一直却没用,就像没改一样,
我的mpm模块如下:
HTML code
 
<IfModule !mpm_netware_module>
    PidFile logs/httpd.pid
</IfModule>

<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>
    LockFile logs/accept.lock
</IfModule>
</IfModule>

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers      5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild  10
</IfModule>

# <IfModule mpm_worker_module>
#    ServerLimit16
#    StartServers          2
#    MaxClients          150
#    MinSpareThreads      25
#    MaxSpareThreads      75
#    ThreadsPerChild      25
#    MaxRequestsPerChild  10
# </IfModule>

# <IfModule mpm_beos_module>
#    StartThreads            10
#    MaxClients              50
#    MaxRequestsPerThread 10000
# </IfModule>
                       
# <IfModule mpm_netware_module>
#    ThreadStackSize      65536
#    StartThreads          250
#    MinSpareThreads        25
#    MaxSpareThreads        250
#    MaxThreads            1000
#    MaxRequestsPerChild      20
#    MaxMemFree            100
# </IfModule>

# <IfModule mpm_mpmt_os2_module>
#    StartServers          2
#    MinSpareThreads        5
#    MaxSpareThreads      10
#    MaxRequestsPerChild    20
# </IfModule>

前段时间,我把后面注释掉的全都打开的,后来才给注释掉的。
服务器每日流量3000左右吧,最多不超过5000
求大侠救小第一命,不然要被老板宰啰
网上的资料我都看得差不多了,试过了都没用...
另外,服务器是windows2003的,2个G的内存,我看了下,cpu使用率最多不会超过50%,就算我手动结束掉进程,但那数字又立马窜得老高,

[解决办法]
深奥,!检查是不是程序问题,从错误报告来看,是由于进程发生冲突,造成服务器不断的重启,。仔细检查程序是不是有的地方没有做好。

此外,检查服务器是不是受到攻击。

从你每隔2天或者1天就出现这个问题来看,应该可以排除配置的原因,如果配置错误,要么就运行出错,要么就正常,一般不可能出现间隔性的错误,。

[解决办法]
关于apache的优化,推荐一篇:http://www.bsdlover.cn/html/36/n-336.html
------解决方案--------------------


PHP code
<IfModule mpm_prefork_module>    StartServers          5    MinSpareServers       5    MaxSpareServers      10    MaxClients          150    MaxRequestsPerChild   10</IfModule>
[解决办法]
看一下系统的其他记录,比如登录和访问记录,看是不是有人攻击。
[解决办法]
你去/php5/ext目录下看一看有没有这些dll.
如果你不需要这些dll,就去php.ini中去掉这些dll的加载,如果需要就去找dll,不一定默认在/php5/ext目录下的。
官网下载,不代表不需要自己去配置。

MaxRequestsPerChild 50表示当超过50个线程时,Apache会kill掉最旧的来回收资源。这个不算Apache重启。



[解决办法]
还有,既然你发现有人试图攻击就要防范,不一定别人取到你的用户密码才叫攻击,如果他不停访问你的服务器,会增加服务器的负荷,引起服务器宕机的。
[解决办法]
不有个apache专区么,这边解决不了就转到那边看看。
[解决办法]
是不是httpd.exe 100%cpu?
我的有时候也有这毛病 据说apache 本身有这个问题
关注。。。。
[解决办法]
windows下apache是一直有这个问题的,建议楼主换成IIS或签到Linux服务器下。
[解决办法]
楼主都真么说了~ ~
排查问题不是ME强项YE~
我这电脑有时候apache就是启不来~老觉得是领导在监控我工作。

热点排行