fd-limits.html revision 2eaf662cbc81e823e8d9aeb8d54e69e63032493e
2ronwalf<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2ronwalf "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2ronwalf
2ronwalf<html xmlns="http://www.w3.org/1999/xhtml">
2ronwalf <head>
2ronwalf <meta name="generator" content="HTML Tidy, see www.w3.org" />
2ronwalf
2ronwalf <title>Apache Server Virtual Host Support</title>
2ronwalf </head>
2ronwalf <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
2ronwalf
2ronwalf <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
2ronwalf vlink="#000080" alink="#FF0000">
2ronwalf <!--#include virtual="header.html" -->
2ronwalf
2ronwalf <h1 align="CENTER">File Descriptor Limits</h1>
2ronwalf
2ronwalf <p>When using a large number of Virtual Hosts, Apache may run
2ronwalf out of available file descriptors (sometimes called <cite>file
2ronwalf handles</cite> if each Virtual Host specifies different log
2ronwalf files. The total number of file descriptors used by Apache is
2ronwalf one for each distinct error log file, one for every other log
2ronwalf file directive, plus 10-20 for internal use. Unix operating
2ronwalf systems limit the number of file descriptors that may be used
2ronwalf by a process; the limit is typically 64, and may usually be
2ronwalf increased up to a large hard-limit.</p>
2ronwalf
2ronwalf <p>Although Apache attempts to increase the limit as required,
2ronwalf this may not work if:</p>
2ronwalf
2ronwalf <ol>
2ronwalf <li>Your system does not provide the setrlimit() system
2ronwalf call.</li>
2ronwalf
2ronwalf <li>The setrlimit(RLIMIT_NOFILE) call does not function on
2ronwalf your system (such as Solaris 2.3)</li>
2ronwalf
2ronwalf <li>The number of file descriptors required exceeds the hard
2ronwalf limit.</li>
2ronwalf
2ronwalf <li>Your system imposes other limits on file descriptors,
2ronwalf such as a limit on stdio streams only using file descriptors
2ronwalf below 256. (Solaris 2)</li>
2ronwalf </ol>
2ronwalf In the event of problems you can:
2ronwalf
2ronwalf <ul>
2ronwalf <li>Reduce the number of log files; don't specify log files
2ronwalf in the VirtualHost sections, but only log to the main log
2ronwalf files.</li>
2ronwalf
2ronwalf <li>
2ronwalf If you system falls into 1 or 2 (above), then increase the
2ronwalf file descriptor limit before starting Apache, using a
2ronwalf script like
2ronwalf
2ronwalf <blockquote>
2ronwalf <code>#!/bin/sh<br />
2ronwalf ulimit -S -n 100<br />
2ronwalf exec httpd</code>
2ronwalf </blockquote>
2ronwalf </li>
2ronwalf </ul>
2ronwalf
2ronwalf <p>Please see the <a
2ronwalf href="/misc/descriptors.html">Descriptors and Apache</a>
2ronwalf document containing further details about file descriptor
2ronwalf problems and how they can be solved on your operating
2ronwalf system.</p>
2ronwalf <!--#include virtual="footer.html" -->
2ronwalf </body>
2ronwalf</html>
2ronwalf
2ronwalf