Windows apache httpd 卡死解决办法

我用WAMP 在 windows10 上搭建了一个 PHP服务器,最近几天经常出现卡机现象,由于是局域网服务器,排除网速原因,

于是查找资料发现 apache 有一个最大线程进程设置的参数,


配置文件在   apache2.4.9\conf\extra\httpd-mpm.conf


找到这个节点,默认是这样的,


# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxConnectionsPerChild: maximum number of connections a server process serves

    ThreadsPerChild        125
    MaxConnectionsPerChild   0


最多支持125个线程,也就是如果并发超过125就会出现下面的错误,然后 apache 会重启进程,查看 apache_error.log 可以看到如下错误


[Mon Apr 14 08:30:31.369273 2014] [mpm_winnt:notice] [pid 2080:tid 380] AH00418: Parent: Created child process 2440
[Mon Apr 14 08:30:31.963031 2014] [mpm_winnt:notice] [pid 2440:tid 1460] AH00354: Child: Starting 150 worker threads.
[Mon Apr 14 09:54:09.534883 2014] [mpm_winnt:notice] [pid 2080:tid 380] AH00422: Parent: Received shutdown signal -- Shutting down the server.


125个线程对于I7 24G内存的主机来讲毛毛雨啊,于是我改成这样


# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxConnectionsPerChild: maximum number of connections a server process serves

    ThreadsPerChild        1024
    MaxConnectionsPerChild   4096


这下可以高正无忧了


你可能感兴趣的:(linux,shell,后端技术)