Apache 2 Performance Tuning

  • Post author:
  • Post category:Apache

Here’s a list of performance tips taken from the official Apache Performance Tuning documentation. This is meant to serve as a quick cheat sheet. For the details, the trade-offs, the why and when to use these optimizations, please read the complete documentation. All these are for tuning your Apache server for every last ounce of performance, and a few are not applicable to many real world Apache installations.

  • Configure MaxClients to prevent swapping. Use top to determine the size of the average Apache process, and divide it by the total available memory. Make sure to leave room for other processes.
  • Use HostnameLookups off.
  • Use IP addresses instead of Allow from domain or Deny from domain.
  • Set FollowSymLinks. Do not set SymLinksIfOwnerMatch.
  • Use AllowOverride None.
  • Do not use wildcards in DirectoryIndex.
  • Creating a type-map file provides better performance than using MultiViews.
  • Remove unused modules. Minimum modules are mod_mime, mod_dir, and mod_log_config.
  • Compile the appropriate MPM.
  • Use –enable-nonportable-atomics during compilation.
  • Set ExtendedStatus off.
  • Disable dynamically loaded modules during compilcation using -DDYNAMIC_MODULE_LIMIT=0.

It’s now unnecessary to configure the MinSpareServers, MaxSpareServers and StartServers settings.