Apache HTTP Server Version 1.3

Hints on Running a High-Performance Web
Server

Running Apache on a heavily loaded web server, one often
encounters problems related to the machine and OS
configuration. "Heavy" is relative, of course - but if you are
seeing more than a couple hits per second on a sustained basis
you should consult the pointers on this page. In general the
suggestions involve how to tune your kernel for the heavier TCP
load, hardware/software conflicts that arise, etc.

Some SVR4 versions waste three system calls on every
gettimeofday() call. Depending on the syntactic
form of the TZ environment variable, these systems
have several different algorithms to determine the local time
zone (presumably compatible with something). The
following example uses the central european time zone to
demonstrate this:

TZ=:MET

This form delegates the knowledge of the time zone
information to an external compiled zoneinfo file (à
la BSD).Caveat: Each time the gettimeofday()
function is called, the external zone info is read in again
(at least on some SVR4 systems). That results in three
wasted system calls with every apache request served.

This syntax form (à la SYSV) contains all the
knowledge about time zone beginning and ending times in its
external representation. It has to be parsed each time it is
evaluated, resulting in a slight computing overhead, but it
requires no system call. Though the table lookup à la
BSD is the more sophisticated technical solution, the bad
SVR4 implementation makes this the preferred syntax on
systems which otherwise access the external zone info file
repeatedly.

You should use the truss utility on a
single-process apache server (started with the -X
debugging switch) to determine whether your system can profit
from the second form of the TZ environment
variable. If it does, you could integrate the setting of the
preferred TZ syntax into the httpd startup script,
which is usually simply a copy of (or symbolic link to) the
apachectl utility script, or into the system's
/etc/TIMEZONE script.