(24)Too many open files: mod_fcgid

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

Status: 
Closed (fixed)

Comments

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.

That was what was missing. We added

www-data     hard    nofile             16384

And I haven't had any errors since.

Thanks!

Chris

Great, I'm glad it's working! Thanks for the update.