关于APACHE.exe只创建不关闭子进程的问题请教

关于APACHE.exe只创建不关闭子进程的问题请教

WINDOWS 2000 ADVANCE SERVER.
APACHE2.0.59

今天突然发现任务管理器里有大量10多个APACHE.EXE进程. 并且一直是新创建不关闭.

请教一下高手.这是怎么回事? 谢谢!!

LOG中看到如下信息:


[Fri Aug 03 10:22:26 2007] [notice] Child 4132: Process exiting because it reached MaxRequestsPerChild. Signaling the parent to restart a new child process.
[Fri Aug 03 10:22:26 2007] [notice] Parent: Received restart signal -- Restarting the server.
[Fri Aug 03 10:22:26 2007] [notice] Apache/2.0.59 (Win32) configured -- resuming normal operations
[Fri Aug 03 10:22:26 2007] [notice] Server built: Jul 27 2006 15:55:03
[Fri Aug 03 10:22:26 2007] [notice] Parent: Created child process 4476
[Fri Aug 03 10:22:26 2007] [notice] Disabled use of AcceptEx() WinSock2 API
[Fri Aug 03 10:22:26 2007] [notice] Child 4476: Child process is running
[Fri Aug 03 10:22:27 2007] [notice] Child 4132: Released the start mutex
[Fri Aug 03 10:22:27 2007] [notice] Child 4476: Acquired the start mutex.
[Fri Aug 03 10:22:27 2007] [notice] Child 4476: Starting 150 worker threads.
[Fri Aug 03 10:22:27 2007] [notice] Child 4132: Waiting for 150 worker threads to exit.
[Fri Aug 03 10:22:27 2007] [notice] Child 4476: Listening on port 80.
[Fri Aug 03 10:25:27 2007] [notice] Child 4132: Terminating 4 threads that failed to exit.
[Fri Aug 03 10:26:08 2007] [notice] Parent: child process exited with status 128 -- Restarting.
up
当达到MaxRequestsPerChild时,apache的parent thread会启动一个新的child thread,这时你的系统中会停有3个httpd.exe进程,直到上一个进程的所有child thread都结速后,进程才会退出。


看看这几个配置吧


httpd.conf配置:

ThreadsPerChild 100
MaxRequestsPerChild 1000
MaxMemFree 16
ThreadLimit 100
ThreadStackSize 8192
KeepAliveTimeout 2
MaxKeepAliveRequests 10
这几个参数分别代表什么意思?

我的这个问题又是怎么回事呢?  我看了一下,每个APACHE.EXE子进程中有154个线程, 日志中"Child 4132: Terminating 4 threads that failed to exit." 似乎是子进程中有部分线程没有退出. 造成了进程没有结束.

另外,我这里只有APACHE.EXE进程, 没有HTTPD.EXE进程.


即使运行APACHE的停止命令  "C:\Program Files\Apache Group\Apache2\bin\Apache.exe" -w -n "Apache2" -k stop
之后,那些APACHE.EXE子进程还是没有停掉.

另外,你说的以上参数中, 我这里的配置文件里只有以下4个. 其它没有.  分别如下所示:

<IfModule mpm_winnt.c>
Win32DisableAcceptEx
ThreadsPerChild 150
MaxRequestsPerChild  1000
</IfModule>

KeepAliveTimeout 5

MaxKeepAliveRequests 300

再说明一下:我这个APACHE只是用于转发请求.  本身没有WEB服务.

只是将请求转发到另一台WEBLOGIC的服务器上.
现在又出现新问题, 除了80端口外,现在这个APACHE服务器什么端口都连接不上了.


QUOTE:
原帖由 varchar2aix 于 2007-8-3 14:06 发表
这几个参数分别代表什么意思?

我的这个问题又是怎么回事呢?  我看了一下,每个APACHE.EXE子进程中有154个线程, 日志中"Child 4132: Terminating 4 threads that failed to exit." 似乎是子进程中有部分线程没 ...

看看这个能找到你知道的参数说明

http://man.chinaunix.net/newsoft ... mod/directives.html