Our Apache error.log file is being filled up with lots of these errors:
[Thu Jul 29 10:35:02 2010] [error] (24)Too many open files: mod_fcgid: couldn't set child process attributes: /var/lib/apache2/fcgid/sock/26667.22574 [Thu Jul 29 10:35:02 2010] [warn] (24)Too many open files: mod_fcgid: spawn process /home/xxx-xxx/www/index.php error
We have a lot of websites hosted on this system and have seen this start as new sites have been added. Initially if a site started to fail it would not load and then in /etc/apache2/mods-available/fcgid.conf set 'MaxRequestsPerProcess 500'.
This seems to have allowed the process to die or be shut down without having to constantly restart Apache as we were doing prior to setting that value. What it hasn't done is stopped the errors, the log is literally inundated with these errors for many different sites.
Any ideas?
Chris
Comments
Submitted by andreychek on Thu, 07/29/2010 - 15:59 Comment #1
Howdy -- you may need to bump up the total number of open files that's allowed, which by default may not scale to the number of sites you have running.
There's a few ways to do that -- one of those is to edit /etc/security/limits.conf, and add something like:
www-data hard nofile 16384
Another possibility would be to add a line to your apache init script, something like:
ulimit -n 16384
You may also want to review your exist /etc/security/limits.conf contents, and make sure none of the limits setup in there for your users are too small for what they require.
Submitted by clwheatley on Fri, 07/30/2010 - 00:54 Comment #2
That was what was missing. We added
www-data hard nofile 16384
And I haven't had any errors since.
Thanks!
Chris
Submitted by andreychek on Fri, 07/30/2010 - 08:54 Comment #3
Great, I'm glad it's working! Thanks for the update.