apache在windows下的内存无法自动释放
dukq 2011-02-25 05:02:17 在windows下,mpm_winnt.c作为apache的默认MPM。相应的ThreadsPerChild和MaxRequestsPerChild作为两个重要参数。
由于apache是和webdav一起工作,作为网络硬盘为用户提供下载服务。因此每个下载链接可能会持续比较长的时间。
现设置如下:
ThreadsPerChild 1000
MaxRequestsPerChild 5000
在测试过程中,出现了如下错误提示:
[Fri Feb 25 15:51:46 2011] [notice] Child 2964: Waiting 270 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:52:16 2011] [notice] Child 2964: Waiting 240 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:52:46 2011] [notice] Child 2964: Waiting 210 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:53:16 2011] [notice] Child 2964: Waiting 180 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:53:46 2011] [notice] Child 2964: Waiting 150 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:54:16 2011] [notice] Child 2964: Waiting 120 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:54:46 2011] [notice] Child 2964: Waiting 90 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:55:16 2011] [notice] Child 2964: Waiting 60 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:55:46 2011] [notice] Child 2964: Waiting 30 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:56:16 2011] [notice] Child 2964: Waiting 0 more seconds for 550 worker threads to finish.
[Fri Feb 25 15:56:16 2011] [notice] Child 2964: Terminating 550 threads that failed to exit.
[Fri Feb 25 15:56:16 2011] [notice] Child 2964: All worker threads have exited.
也就是说有550个工作线程无法终止,若不重启apache服务器,此后,apache最多只能接受450个下载链接。如此循环下去,最后导致apache无法接受客户的下载链接请求。
请教各位,应该如何设置这两个参数,一般这两个参数之间有没有一定的关系,比如MaxRequestsPerChild和ThreadsPerChild之间是否存在一定的比例。
如果把MaxRequestsPerChild设置为0,则根据apache的渐长内存管理机制,一段时间之后肯定会将服务器内存耗尽。设置为其他值,则很可能导致有部分线程无法正常终止,如此循环,最后导致apache无法提供服务。
谁知道如何搞定这个问题啊?
谢了哈