Performance Tuning Apache - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Performance Tuning Apache

Description:

Layer-4 Ethernet switches for loadbalancing and fallback. What is performance tuning ... Throttle popular sites or directories. By OS, or mod_bandwidth or mod_throttle ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 14
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 (no
    Windows)
  • User homepages (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
  • Utilizing resources as efficiently as possible
  • Not always speed!
  • Its not always a good idea
  • Use with care It can break things
  • Buy more hardware instead
  • Helps against bottlenecks, not underpowered
    systems as a whole

5
Tuning Apache (1)Make Apache do less
  • Disable unused processing (pre and post)
  • mod_includes
  • ExtendedStatus
  • Disable DNS and User lookups
  • Avoid disk operations
  • AllowOverride
  • FollowSymlinks
  • mod_disallow_uid for security

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

7
Tuning Apache (2)Make Apache wait less
  • Tune process model
  • MinSpareServers
  • MaxSpareServers
  • StartServers
  • MaxClients
  • MaxRequestsPerChild

8
Tuning Apache (3)
  • Avoid running other applications on the same
    servers
  • Do not run out of memory
  • Swapping kills performance
  • Offload functionality
  • Use a frontproxy to serve static data
  • Use a frontproxy or similar to handle SSL

9
Tuning Apache (4)Make Apache work smartly
  • Compress data
  • mod_gzip or mod_compress
  • Throttle popular sites or directories
  • By OS, or mod_bandwidth or mod_throttle
  • For mass virtualhosting, use mod_rewrite or
    mod_vhost_alias
  • Write site-specific modules, or adapt existing
    ones

10
Example
  • mod_gzip_enable Yes
  • mod_gzip_item_include mime text/.
  • mod_gzip_item_exclude mime text/compressed
  • BandwidthModule On
  • ltDirectory /homegt
  • Bandwidth 194.109.0.0/23 0
  • Bandwidth all 1024
  • MinBandwidth -1
  • lt/Directorygt
  • XS4ALLUserDir WWW

11
Tuning Applications
  • Optimize your scripts/programs
  • Use a language specific interpreter-module
  • mod_perl
  • mod_python, mod_snake
  • mod_dtcl, NeoScript, many more
  • mod_php
  • mod_ruby
  • Use FastCGI
  • Rewrite C programs directly into Apache as a
    module

12
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)

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