Too Many Open Files

cwihost

Verified User
Joined
Nov 23, 2005
Messages
6
I am having a problem that is keeping Apache from starting. It started yesterday, Apache crashed and would not start. I thought it may have been mod_layout, so I disabled that and it started, but only for a little while. It crashed again and I have not been able to get it back up.

There are about 1000 virtual hosts on the site each with 3 log files each. Doing an lsof shows that apache has the most open files when starting and then it dies, the only way I can get the actual reason it died is by doing a service httpd graceful and then it logs the error.

I have used ulimit to set the open files to 9999 and I have also set sysctl.conf to an extremely high number. and restarted the system. This has no change. I am thinking that the problem is that when Apache tries to start, it cannot because the number of log files is taking up all of the open file descriptors.

Does anyone have a comment on this or what can be done to reduce the number of log files etc?
 
There are a couple of threads on the board about this issue as well as this knowledgebase entry:

http://help.directadmin.com/item.php?id=9

At one point a couple of us were playing with some other methods for logging that didn't require descriptors for every virtual log file, but I'm not sure where we left that.
 
I went ahead and removed the CustomLog and Error Log entries from the virtual_hosts.conf and related templates. I then wrote a perl script to go through each of the 1200 httpd.conf files and remove those 6 lines (3 for non SSL and 3 for SSL) and restarted and it worked. Was just that there were too many log files trying to be opened.
 
Back
Top