Forum Moderators: phranque

Message Too Old, No Replies

Redhat ES 3.0 Apache 2.4 problem: too many open files

too many files open: couldn't spawn child process

         

whitequeen

11:05 pm on Sep 2, 2004 (gmt 0)

10+ Year Member



Here is the message I receive:
too many files open: couldn't spawn child process

Redhat ES 3.0 Apache 2.4
Can the maximum number of possible open files be icreased?
Here is part of my /etc/httpd/conf/httpd.conf:
<IfModule prefork.c>
ServerLimit 512
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 512
MaxRequestsPerChild 1000
</IfModule>
....
....
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 128
MaxRequestsPerChild 0
------------------ 8< ---------------------
And here is part of my /etc/security/limits.conf file:
* soft nofile 2048
* hard nofile 2048

Any ideas!

Thanks in advance.

drbrain

11:12 pm on Sep 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What kind of content is being run on this server? Static or dynamic content? How long is the server in operation before this starts happening (both in time and in hits).

If you have static pages, how much traffic? Lots? Does the message only occur during times of high load? You need to do some tuning and raise those limits.

If you're running dynamic content you may be leaking file handles. Running out of files after a consistent amount of hits points in this direction, but if you're using mod_php or mod_perl, this is less likely.

You can use a tool like lsof ("list open files") to determine who is holding on to files. This may give you clues about why this is happening (for example, a bunch of temporary files).

Allowing more file descriptors will have negative impacts on other areas of the system. You will need to read your OS and Apache's tuning documents to figure out how best to balance these.

whitequeen

3:31 pm on Sep 3, 2004 (gmt 0)

10+ Year Member



I may be in the wrong forum because I think my problem is a RedHat soft and hard limit setting which needs to be increased so that we can add more web sites. The problem is we can't add more web sites to the server without it saying 'too many files open: can't spawn child processes'. I am not the apache administrator of all these web sites, my client is and they say they have about 400 web sites on this server. When they remove the test web sites the problem goes away which means I have some grace time to try to figure this out. I am new at the job of administrating the RedHat ES 3.0 OS.
In the following config file:
/etc/httpd/conf/httpd.conf
I added in the 'ServerLimit' line in the section titled...
<IfModule prefork.c>
ServerLimit 512
Also, I changed MaxClients setting from 150 to 500

Now on Solaris it would be the /etc/system file which would need to be updated but I don't know what to set on Red Hat Linux.

/etc/security/limits.conf?
/sbin/sysctl?

ulimit -n 2048
(increase from 1024)
works but only for a root user session.

Thanks for any help you can provide.