Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 09E889310 for ; Wed, 25 Apr 2012 11:52:35 +0000 (UTC) Received: (qmail 68938 invoked by uid 500); 25 Apr 2012 11:52:34 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 68715 invoked by uid 500); 25 Apr 2012 11:52:34 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 68696 invoked by uid 99); 25 Apr 2012 11:52:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 11:52:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 11:52:31 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A54F023889E0; Wed, 25 Apr 2012 11:52:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1330220 - /httpd/httpd/trunk/docs/manual/misc/perf-scaling.xml Date: Wed, 25 Apr 2012 11:52:11 -0000 To: cvs@httpd.apache.org From: igalic@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120425115211.A54F023889E0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: igalic Date: Wed Apr 25 11:52:11 2012 New Revision: 1330220 URL: http://svn.apache.org/viewvc?rev=1330220&view=rev Log: Fix XML validation Modified: httpd/httpd/trunk/docs/manual/misc/perf-scaling.xml Modified: httpd/httpd/trunk/docs/manual/misc/perf-scaling.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/misc/perf-scaling.xml?rev=1330220&r1=1330219&r2=1330220&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/misc/perf-scaling.xml (original) +++ httpd/httpd/trunk/docs/manual/misc/perf-scaling.xml Wed Apr 25 11:52:11 2012 @@ -55,14 +55,14 @@ -
+
What Will and Will Not Be Discussed

The session will focus on easily accessible configuration and tuning options for Apache httpd 2.2 and 2.3 as well as monitoring tools. Monitoring tools will allow you to observe your web server to gather information about its performance, or lack thereof. - We'll assume that you don't have an unlimited budget for + We'll assume that you don't have an unlimited budget for server hardware, so the existing infrastructure will have to do the job. You have no desire to compile your own Apache, or to recompile the operating system kernel. We do assume, though, that you have @@ -71,7 +71,7 @@

-
+
Monitoring Your Server

The first task when sizing or performance-tuning your server is to @@ -82,7 +82,7 @@

-
+
Monitoring Tools @@ -91,7 +91,7 @@ top

The top tool ships with Linux and FreeBSD. Solaris offers - `prstat'. It collects a number of statistics for the + `prstat'. It collects a number of statistics for the system and for each running process, then displays them interactively on your terminal. The data displayed is refreshed every second and varies by platform, but @@ -179,10 +179,10 @@ top ten CPU gluttons). It is indispensable in determining the size of a running process, which comes in handy when determining how many server processes you can run on your - machine. How to do this is described in ' + machine. How to do this is described in ' sizing MaxClients - '. Top is, however, an interactive tool and running it + '. Top is, however, an interactive tool and running it continuously has few if any advantages.

@@ -194,10 +194,10 @@ memory as file system cache. The free command shows usage both with and without this cache. The free command can be used to find out how much memory the operating system is - using, as described in the paragraph ' + using, as described in the paragraph ' Sizing MaxClients - '. The output of free looks like this: + '. The output of free looks like this:

@@ -274,7 +274,7 @@
-
+
SE Toolkit

The SE Toolkit is a system monitoring toolkit for Solaris. @@ -301,11 +301,11 @@

-
+
DTrace

Given that DTrace is available for Solaris, FreeBSD and OS - X, it might be worth exploring it. There's also + X, it might be worth exploring it. There's also mod_dtrace available for httpd.

@@ -335,7 +335,7 @@
-
+
Web Server Log Files

Monitoring and analyzing the log files httpd writes is one of @@ -351,7 +351,7 @@

-
+
Error Log

The error log will contain messages if the server has @@ -391,7 +391,7 @@ directive can also be used in virtual host containers. The error log of a virtual host receives only log messages specific to that virtual host, such as authentication - failures and 'File not Found' errors. + failures and 'File not Found' errors.

On a server that is visible to the Internet, expect to see a lot of exploit attempt and worm attacks in the error log. A @@ -528,7 +528,7 @@

-
+
Access Log

Apache httpd keeps track of every request it services in its @@ -695,7 +695,7 @@

-
+
Rotating Log Files

There are several reasons to rotate logfiles. Even though @@ -769,7 +769,7 @@

-
+
Logging and Performance

Writing entries to the Apache log files obviously takes some @@ -797,20 +797,14 @@ easier to analyze the logfile later. However, if your server has many virtual hosts, all the open logfiles put a resource burden on your system, and it may be preferable to - log to a single file. Use the %v - - format character at the start of your - LogFormat - - and starting 2.3.8 of your ErrorLogFormat - + log to a single file. Use the %v + format character at the start of your LogFormat + and starting 2.3.8 of your ErrorLog to make httpd print the hostname of the virtual host that received the request or the error at the beginning of each log line. A simple Perl script can split out the log file after it rotates: one is included with the Apache source - under support/split-logfile - - . + under support/split-logfile.

You can use the BufferedLogs @@ -818,20 +812,18 @@ directive to have Apache collect several log lines in memory before writing them to disk. This might yield better performance, but could affect the order in which the - server's log is written. + server's log is written.

-
+
Generating A Test Load

It is useful to generate a test load to monitor system performance under realistic operating circumstances. Besides - commercial packages such as - LoadRunner - + commercial packages such as LoadRunner ,there are a number of freely available tools to generate a test load against your web server.

@@ -858,9 +850,7 @@
  • ASF external projects, that have proven to be quite - good: grinder, httperf, tsung, - FunkLoad - + good: grinder, httperf, tsung, FunkLoad

  • @@ -873,12 +863,12 @@
    -
    +
    Configuring for Performance -
    +
    Apache Configuration

    The Apache 2.2 httpd is by default a pre-forking web server. @@ -894,9 +884,8 @@ MPM runs a smaller number of child processes, and spawns multiple request handling threads within each child process. In 2.3+ MPMs are no longer hard-wired. They too can be exchanged - via LoadModule - - .The default MPM in 2.3 is the event MPM. + via LoadModule. + The default MPM in 2.3 is the event MPM.

    The maximum number of workers, be they pre-forked child processes or threads within a process, is an indication of how @@ -904,7 +893,7 @@ a rough estimate because the kernel can queue connection attempts for your web server. When your site becomes busy and the maximum number of workers is running, the machine - doesn't hit a hard limit beyond which clients will be + doesn't hit a hard limit beyond which clients will be denied access. However, once requests start backing up, system performance is likely to degrade.

    @@ -932,7 +921,7 @@
    -
    +
    Spinning Threads

    For the prefork MPM of the above directives are all there is @@ -958,7 +947,7 @@

    -
    +
    Sizing MaxClients

    Optimally, the maximum number of processes should be set so @@ -989,7 +978,7 @@

    The difference between these two is the amount of memory per-process. The shared segment really exists only once and is used for the code and libraries loaded and the dynamic - inter-process tally, or 'scoreboard,' that Apache + inter-process tally, or 'scoreboard,' that Apache keeps. How much memory each process takes for itself depends heavily on the number and kind of modules you use. The best approach to use in determining this need is to @@ -1019,7 +1008,7 @@

    -
    +
    Selecting your MPM

    The prime reason for selecting a threaded MPM is that @@ -1056,14 +1045,14 @@

    -
    +
    Spinning Locks

    Apache httpd maintains an inter-process lock around its network listener. For all practical purposes, this means that only one httpd child process can receive a request at any given time. The other processes are either servicing - requests already received or are 'camping out' on + requests already received or are 'camping out' on the lock, waiting for the network listener to become available. This process is best visualized as a revolving door, with only one process allowed in the door at any @@ -1081,10 +1070,10 @@

    -
    +
    The Thundering Herd -

    The function of the 'accept mutex' (as this +

    The function of the 'accept mutex' (as this inter-process lock is called) is to keep request reception moving along in an orderly fashion. If the lock is absent, the server may exhibit the Thundering Herd syndrome. @@ -1132,10 +1121,10 @@

    -
    +
    Tuning the Operating System -

    People often look for the 'magic tune-up' that will +

    People often look for the 'magic tune-up' that will make their system perform four times as fast by tweaking just one little setting. The truth is, present-day UNIX derivatives are pretty well adjusted straight out of the box and there is @@ -1145,7 +1134,7 @@

    -
    +
    RAM and Swap Space

    The usual mantra regarding RAM is "more is @@ -1163,7 +1152,7 @@ different ways, it is never a good idea to run with less disk-based swap space than RAM. The virtual memory system is designed to provide a fallback for RAM, but when you - don't have disk space available and run out of + don't have disk space available and run out of swappable memory, your machine grinds to a halt. This can crash your box, requiring a physical reboot for which your hosting facility may charge you. @@ -1206,7 +1195,7 @@

    -
    +
    ulimit: Files and Processes

    Given a machine with plenty of RAM and processor capacity, @@ -1260,7 +1249,7 @@

    -
    +
    Setting User Limits on System Startup

    Under Linux, you can set the ulimit parameters on bootup by @@ -1277,19 +1266,19 @@ session required /lib/security/pam_limits.so -

    All items can have a 'soft' and a 'hard' +

    All items can have a 'soft' and a 'hard' limit: the first is the default setting and the second the maximum value for that item.

    - In FreeBSD's /etc/login.conf + In FreeBSD's /etc/login.conf these resources can be limited or extended system wide, analogously to limits.conf - .'Soft' limits can be specified with -cur + .'Soft' limits can be specified with -cur - and 'hard' limits with -max + and 'hard' limits with -max .

    @@ -1326,7 +1315,7 @@
    -
    +
    Turn Off Unused Services and Modules

    Many UNIX and Linux distributions come with a slew of @@ -1351,7 +1340,7 @@ directive.

    -

    Unused modules may be culled: if you don't rely on +

    Unused modules may be culled: if you don't rely on their functionality and configuration directives, you can turn them off by commenting out the corresponding LoadModule @@ -1359,14 +1348,14 @@ lines. Read the documentation on each module’s functionality before deciding whether to keep it enabled. While the performance overhead of an unused module is - small, it's also unnecessary. + small, it's also unnecessary.

    -
    +
    Caching Content

    Requests for dynamically generated content usually take @@ -1386,7 +1375,7 @@

    -