fd-limits.html.en revision f9b3be308809978f797e0c57b296147532a4313c
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff<TITLE>Apache Server Virtual Host Support</TITLE>
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff BGCOLOR="#FFFFFF"
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff TEXT="#000000"
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff LINK="#0000FF"
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff VLINK="#000080"
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff ALINK="#FF0000"
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff<!--#include virtual="header.html" -->
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffWhen using a large number of Virtual Hosts, Apache may run out of available
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Grafffile descriptors (sometimes called <CITE>file handles</CITE> if each Virtual
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffHost specifies different log files.
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffThe total number of file descriptors used by Apache is one for each distinct
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Grafferror log file, one for every other log file directive, plus 10-20 for
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffinternal use. Unix operating systems limit the number of file descriptors that
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffmay be used by a process; the limit is typically 64, and may usually be
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffincreased up to a large hard-limit.
66bd3b3c6b171271c705b897823dcdcf29464698Michael GraffAlthough Apache attempts to increase the limit as required, this
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graffmay not work if:
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff<LI>Your system does not provide the setrlimit() system call.
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff<LI>The setrlimit(RLIMIT_NOFILE) call does not function on your system
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff (such as Solaris 2.3)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff<LI>The number of file descriptors required exceeds the hard limit.
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff<LI>Your system imposes other limits on file descriptors, such as a limit
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graffon stdio streams only using file descriptors below 256. (Solaris 2)
3024dbecbac365171bc6de0f3fa04951d6558be3Michael GraffIn the event of problems you can:
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff<LI>Reduce the number of log files; don't specify log files in the VirtualHost
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffsections, but only log to the main log files.
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley<LI>If you system falls into 1 or 2 (above), then increase the file descriptor
e45d323a2a0f4ca08d4b139546e60a5fa7bd3f0cMichael Grafflimit before starting Apache, using a script like
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graffulimit -S -n 100 <BR>
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael GraffPlease see the
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graff<A HREF="/misc/descriptors.html">Descriptors and Apache</A>
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graffdocument containing further details about file descriptor problems and how
439c0011e642fb1d26011116144af698125262dbMichael Graffthey can be solved on your operating system.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff<!--#include virtual="footer.html" -->