Performance Tuning Apache - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Performance Tuning Apache

Description:

Layer-4 Ethernet switches for loadbalancing and fallback. What is ... Buy more ... Directory /mp3 Bandwidth xs4all.net 0. Bandwidth all 1024. MinBandwidth ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 13
Provided by: thomasw73
Category:

less

Transcript and Presenter's Notes

Title: Performance Tuning Apache


1
Performance Tuning Apache
  • Thomas Wouters
  • XS4ALL
  • thomas_at_xs4all.net

2
Overview
  • Background
  • What is performance tuning
  • Tuning Apache
  • Tuning Applications
  • Tuning the Operating System(s)
  • Questions

3
Background
  • Apache (1.x) on BSDI, FreeBSD and Linux (and no
    MS Windows)
  • User sites (www.xs4all.nl/user)
  • Large-scale virtualhosting
  • Dedicated, high-availability servers
  • NFS storage for data
  • Layer-4 Ethernet switches for loadbalancing and
    fallback

4
What is performance tuning
  • Its about utilizing resources as efficiently as
    possible
  • It isnt always about speed!
  • Its not always a good idea
  • Use with care It can break things
  • Buy more hardware instead
  • Use it to remove or work around bottlenecks, not
    underpowered systems as a whole

5
Tuning Apache (1)Make Apache do less
  • Disable unused pre- and post-processing, like
    mod_includes, mod_speling, and complicated
    mod_log_config directives
  • Disable (or only selectively enable)
    AllowOverride, DNS lookups, ExtendedStatus and
    enable FollowSymlinks
  • Especially over NFS, avoid unnecessary file
    operations like the plague

6
Example
  • HostNameLookups off
  • UserDir /home//WWW
  • DisallowUid 0
  • DisallowGid 0
  • ltDirectory /homegt
  • AllowOverride None
  • Options FollowSymlinks
  • lt/Directorygt

7
Tuning Apache (2)Make Apache wait less
  • Tune StartServers, MinSpareServers,
    MaxSpareServers and MaxClients to avoid forking
    processes
  • Avoid running other applications on the same
    server(s)
  • Take care not to run out of memory swapping
    killls performance
  • Use a front-proxy to cache the results of common
    requests

8
Tuning Apache (3)Make Apache work smartly
  • Compress data before sending it out with mod_gzip
  • Manage popular virtualhosts or directories with
    mod_bandwidth or mod_throttle
  • For mass virtualhosting, use mod_rewrite or
    mod_vhost_alias to collapse the configuration
    tree
  • Write your own site-specific modules, or adapt
    existing ones

9
Example
  • mod_gzip_enable Yes
  • mod_gzip_item_include mime text/.
  • mod_gzip_item_exclude mime text/compressed
  • UserDirXS4ALL WWW
  • BandwidthModule On
  • ltDirectory /mp3gt
  • Bandwidth xs4all.net 0
  • Bandwidth all 1024
  • MinBandwidth -1
  • lt/Directorygt

10
Tuning Applications
  • Optimize your scripts/programs -)
  • Redo your scripts to use mod_perl, mod_python,
    mod_snake or your favorite language module
  • Rewrite your scripts to use FastCGI
  • Embed your C programs directly into Apache by
    making them a module

11
Tuning the Operating System
  • Free up memory
  • Raise process limits (for Apache)
  • Disable process accounting
  • Tune the kernel (maxproc, shmem, maxfd, TCP
    stack)
  • When possible, disable atime updates
  • Choose the best accept-serializing strategy (in
    Apache 2.0, choose the best MPM)

12
Questions ?
  • These slides will be available from
    http//www.xs4all.nl/thomas/apachecon
  • Email me at thomas_at_xs4all.net
Write a Comment
User Comments (0)
About PowerShow.com