联系我们:416326801#qq.com(#改成@)

Latest from the blog

[emerg] (43)Identifier removed: couldn't grab the accept mutex

标签: Linux Apache

查看apache日志

cat /var/wwwlogs/error
[emerg] (43)Identifier removed: couldn't grab the accept mutex
[emerg] (43)Identifier removed: couldn't grab the accept mutex
[emerg] (43)Identifier removed: couldn't grab the accept mutex
[emerg] (43)Identifier removed: couldn't grab the accept mutex
[alert] Child 9928 returned a Fatal error... Apache is exiting!
[emerg] (22)Invalid argument: couldn't release the accept mutex


处理办法,修改配置文件增加AcceptMutex posixsem

vi /usr/local/apache/conf/vhost/http-mpm.conf
<IfModule mpm_prefork_module>
    StartServers          10
    MinSpareServers       10
    MaxSpareServers      20
    ServerLimit         1500
    MaxClients          1000
    MaxRequestsPerChild 5000
    AcceptMutex posixsem
</IfModule>

优化Apache性能参数

标签: Apache

1、判断Apache工作模式是prefork模式还是worker模式

[root@jishu8 ~]# /usr/local/apache/bin/httpd -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

2、prefork模式参数优化 ServerLimit > MaxClients。

修改ServerLimit必须完全停止服务,即先stop再start,不能直接restart。

vi /usr/local/apache/conf/extra/httpd-mpm.conf
<IfModule mpm_prefork_module>
    StartServers          10
    MinSpareServers       10
    MaxSpareServers      20
    ServerLimit        3500
    MaxClients          3000
    MaxRequestsPerChild   10000
</IfModule>

3、worker模式参数优化

vi /usr/local/apache/conf/extra/httpd-mpm.conf
<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          200
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>