11)Resource temporarily unavailable: couldn't spawn child process

astopy

Well-Known Member
Apr 3, 2003
166
0
166
cPanel Access Level
Root Administrator
After updating the kernel (on RHEL 3) to 2.4.21-27.ELsmp from 2.4.21-20.ELsmp, Apache started giving Internal Server Errors for all PHP pages (and presumably other types of scripts as well). A look at the error log revealed lines such as:
[Fri Jan 28 00:59:35 2005] [error] [client 62.253.32.7] (11)Resource temporarily unavailable: couldn't spawn child process: /home/astopy/public_html/index.php
Setting MaxClients very low (i.e. less than 20) seemed to reduce the frequency of these errors, but did not eliminate them entirely. For now I've switched back to the old kernel, but this is a temporary fix because of known vulnerabilities in that version. My best guess is that the new kernel is enforcing some kind of limits on the number of child processes a process can have that the old kernel is not.

Perhaps someone with more experience than me could shed some light on this?
 

astopy

Well-Known Member
Apr 3, 2003
166
0
166
cPanel Access Level
Root Administrator
Now it seems that it's not the kernel after all. Apache seems to have this error only if it is restarted; it works as normal when it first comes up from a reboot, but restarting apache will produce this problem. I'm going to investigate this further later (don't have time right now), but if anyone has experienced anything similar I'd be grateful for some input.

It may also be worth mentioning that even when things seem to be working normally apache is slow to respond to requests. I also see a lot of these messages in error_log:

[notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
Not sure if they're related.
 

astopy

Well-Known Member
Apr 3, 2003
166
0
166
cPanel Access Level
Root Administrator
Turns out this was caused by Shell Fork Bomb Protection - disabling that fixed it. This is confusing, since that's always been enabled since I set the server up (months ago). I'm also confused as to why the problem only showed itself after Apache was stopped then started again.

For now I'm happy with it Just Working, though.
 

dezignguy

Well-Known Member
Sep 26, 2004
533
0
166
You're still behind on your kernel versions... the latest redhat enterprise kernel is 2.4.21-27.0.2.EL (SMP for you). Yours likely includes several serious security holes.

[notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
So search through your httpd.conf and find the line causing the problem... and edit it so that it's not using a full url?
 

astopy

Well-Known Member
Apr 3, 2003
166
0
166
cPanel Access Level
Root Administrator
dezignguy said:
You're still behind on your kernel versions... the latest redhat enterprise kernel is 2.4.21-27.0.2.EL (SMP for you). Yours likely includes several serious security holes.
Thanks, I'll look into that.

So search through your httpd.conf and find the line causing the problem... and edit it so that it's not using a full url?
That's the thing, there aren't any ErrorDocument lines in httpd.conf that use a full URL. I also used grep to check all my users' .htaccess files, and none of them uses a full URL either. This doesn't seem to be causing any problems, so for now I'm not too worried about it.