windows下apache修改默认线程数方法

Apache在访问量大的时候,出现假死,服务处于启动状态,但是网站无法打开。apache log/error.log文件出现如下提示:
[warn] (OS 64)指定的网络名不再可用。 : winnt_accept: Asynchronous AcceptEx failed.
[Mon Dec 26 21:24:13 2011] [notice] Child 2180: Child process is running
[Mon Dec 26 21:24:13 2011] [notice] Child 2180: Acquired the start mutex.
[Mon Dec 26 21:24:13 2011] [notice] Child 2180: Starting 64 worker threads.
[Mon Dec 26 21:24:13 2011] [notice] Child 2180: Starting thread to listen on port 80.
[warn] Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting
按提示应是apache线程数超过64造成,修改apache默认线程数步骤如下:
1、在conf/httpd.conf文件中修改/添加

<IfModule mpm_winnt_module>
    ThreadsPerChild     1000
    MaxRequestsPerChild    0
</IfModule>

2、在conf/extra/httpd-mpm.conf文件中修改/添加

<IfModule mpm_winnt_module>
    ThreadsPerChild     1000
    MaxRequestsPerChild    0
</IfModule>
转载请注明 :IT樵客

此条目发表在 系统故障 分类目录,贴了 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>