apache crashing

Cristian Rusu asked:

Please help with some ideas about this Apache server crash:

Here is my MPM config and errors

<IfModule prefork.c>
StartServers       5
MinSpareServers    30
MaxSpareServers   40
ServerLimit      950
MaxClients       950
MaxRequestsPerChild  2000
</IfModule>

[Sun Sep 09 03:08:03 2012] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.16 mod_ssl/2.2.15 OpenSSL/1.0.0-fips configured -- resuming normal operations
[Mon Sep 10 17:26:47 2012] [error] [mod_pagespeed 0.10.22.4-1633 @5088] [0910/172647:ERROR:worker.cc(120)] Unable to start worker thread
[Mon Sep 10 17:26:48 2012] [error] [mod_pagespeed 0.10.22.4-1633 @4983] [0910/172648:ERROR:worker.cc(120)] Unable to start worker thread
[Mon Sep 10 17:26:48 2012] [error] [mod_pagespeed 0.10.22.4-1633 @4915] [0910/172648:ERROR:worker.cc(120)] Unable to start worker thread
[Mon Sep 10 17:26:49 2012] [alert] (11)Resource temporarily unavailable: setuid: unable to change to uid: 48
[Mon Sep 10 17:26:49 2012] [error] [mod_pagespeed 0.10.22.4-1633 @5095] [0910/172649:ERROR:worker.cc(120)] Unable to start worker thread
[Mon Sep 10 17:26:49 2012] [error] [mod_pagespeed 0.10.22.4-1633 @5085] [0910/172649:ERROR:worker.cc(120)] Unable to start worker thread
[Mon Sep 10 17:26:49 2012] [error] [mod_pagespeed 0.10.22.4-1633 @4989] [0910/172649:ERROR:worker.cc(120)] Unable to start worker thread
[Mon Sep 10 17:26:50 2012] [alert] Child 5108 returned a Fatal error... Apache is exiting!
[Mon Sep 10 17:26:50 2012] [emerg] (22)Invalid argument: couldn't grab the accept mutex
[Mon Sep 10 17:26:50 2012] [emerg] (22)Invalid argument: couldn't release the accept mutex
[Mon Sep 10 17:26:50 2012] [emerg] (22)Invalid argument: couldn't release the accept mutex
[Mon Sep 10 17:26:50 2012] [emerg] (22)Invalid argument: couldn't grab the accept mutex
[Mon Sep 10 17:26:50 2012] [emerg] (22)Invalid argument: couldn't grab the accept mutex
[Mon Sep 10 17:26:50 2012] [emerg] (22)Invalid argument: couldn't release the accept mutex

My answer:


The most relevant error seems to be:

[Mon Sep 10 17:26:49 2012] [alert] (11)Resource temporarily unavailable: setuid: unable to change to uid: 48

Things just go downhill from there.

This means Apache hit the limit of the maximum number of processes allowed to run.

You can view the limit by running ulimit -u. To increase the limit, run ulimit -u <number> or edit /etc/security/limits.conf (probably Red Hat specific) and add a configuration directive for Apache’s user to increase the value for nproc to something more reasonable.

You can also try reducing Apache’s ServerLimit and MaxClients directives.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.