fd-limits.html revision f9b3be308809978f797e0c57b296147532a4313c
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<HTML>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<HEAD>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<TITLE>Apache Server Virtual Host Support</TITLE>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan</HEAD>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<BODY
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan BGCOLOR="#FFFFFF"
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan TEXT="#000000"
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan LINK="#0000FF"
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan VLINK="#000080"
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan ALINK="#FF0000"
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<!--#include virtual="header.html" -->
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<h1 ALIGN="CENTER">File Descriptor Limits</H1>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<P>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk HoganWhen using a large number of Virtual Hosts, Apache may run out of available
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganfile descriptors (sometimes called <CITE>file handles</CITE> if each Virtual
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk HoganHost specifies different log files.
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk HoganThe total number of file descriptors used by Apache is one for each distinct
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganerror log file, one for every other log file directive, plus 10-20 for
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganinternal use. Unix operating systems limit the number of file descriptors that
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganmay be used by a process; the limit is typically 64, and may usually be
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganincreased up to a large hard-limit.
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<P>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk HoganAlthough Apache attempts to increase the limit as required, this
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganmay not work if:
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<OL>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<LI>Your system does not provide the setrlimit() system call.
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<LI>The setrlimit(RLIMIT_NOFILE) call does not function on your system
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan (such as Solaris 2.3)
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<LI>The number of file descriptors required exceeds the hard limit.
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<LI>Your system imposes other limits on file descriptors, such as a limit
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganon stdio streams only using file descriptors below 256. (Solaris 2)
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan</OL>
cf7084cf20623b8a2d7da2cc101288f2cf516d67Craig McDonnell
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk HoganIn the event of problems you can:
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<UL>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<LI>Reduce the number of log files; don't specify log files in the VirtualHost
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogansections, but only log to the main log files.
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<LI>If you system falls into 1 or 2 (above), then increase the file descriptor
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganlimit before starting Apache, using a script like
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<BLOCKQUOTE><CODE>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan#!/bin/sh <BR>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganulimit -S -n 100 <BR>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganexec httpd</CODE></BLOCKQUOTE>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan</UL>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<P>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk HoganPlease see the
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<A HREF="/misc/descriptors.html">Descriptors and Apache</A>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogandocument containing further details about file descriptor problems and how
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hoganthey can be solved on your operating system.
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan</P>
cf7084cf20623b8a2d7da2cc101288f2cf516d67Craig McDonnell
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan<!--#include virtual="footer.html" -->
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan</BODY></HTML>
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan
857bccfd8dc68379dcdc70acd07c6966dea365d5Dirk Hogan