Return to home page.
Member Control PanelWeb Mail LoginFAQ SupportHelp Desk
COMPANY       SERVICES      HOSTING       SUPPORT       PARTNER PROGRAMS       SIGN UP       DOMAIN NAMES  
Personal / Family Hosting
personal / family
With hosting plans starting at $1.95, it's never been easier to setup and maintain affordable personal web pages or family web sites.
Business / Managed Hosting
Business / Managed
Plans starting at $6.95, help businesses save money and receive value-add features like unlimited email accounts, domain hosting and the flexibility to add services on demand as needed.
Co-Located / Dedicated Servers
Co-Location / Dedicated
Starting at $49.95, our managed hosting plans offers competitive service features at a great value. Attractive co-location servicesstart at $100.

Tuning Apache for Performance

The apache web server is the most popular and most widely used web server today. They are used not only for hosting smaller websites, but also for hosting full scale commercial sites that deliver complex content to multiple simultaneous users.

While apache is built to serve under tough conditions, there is always scope for improving (or for that matter, degrading) their performance depending on how they are configured. This configuration takes place mainly in the httpd.conf file usually placed in the $PATH/apache2/bin/ folder.

Below we have discussed a few tips on how to extract maximum performance from your apache web server. (1.3 and 2.0). Please bear in mind that while these tips are in general, every website (depending on it's specific needs) may require a slightly different set of performance tuning steps. While we cannot cover every possible scenario, we are attempting to generalize and provide the most common and universally applicable tips.

These and more tips for performance tuning Apache for optimization are discussed in detail at http://httpd.apache.org/docs/misc/perf-tuning.html.

Hardware:

  1. The primary factor that can control the performance of apache or any webserver is the fact that a web server should never ever have to swap memory as this leads to latency for each request made to it. Therefore greater the RAM for the system, higher the performance. However, just by getting more RAM may not solve your speed issues. As mentioned in the initial paragraphs, configuring your httpd.conf file is as important.
  2. Based on your web server's average process size, the MaxClients value should be controlled such that the number of child processes are limited. This will prevent swapping. A simple and shortcut way of determining this would be to divide the total memory available by the average apache process size.
  3. Of course, other hardware bottlenecks can be CPU, Network Card, Hard disks, and to some extent the operating system.

Configuration file tuning:

  1. Keeping HostnameLookups Off would reduce latency to the requests as a DNS lookup would not be required.
  2. Using any Allow From domain or deny from domain then directives, then it would involve a double DNS lookup thus deteriorating performance. If directives have to be used, then use IP addresses instead of names.
  3. For highest performance and no symlink protection, set FollowSymlinks everywhere and never set SymlinksIfOwnerMatch. If you do need to set these for security reasons, please follow the procedures described in detail in the URL listed above.
  4. Set AllowOverride None everywhere in the filesystem. If it is set otherwise, then Apache will attempt to open each .htaccess file for each filename component.
  5. Instead of using an undefined DirectoryIndex index statement, use a complete list of possible options such as DirectoryIndex index.html index.php index.shtml index.cgi.
  6. Only enable those modules that are absolutely required since each module implies an additional processing overhead.
  7. Using static content whereever possible also results in an improved performance. It the data is dynamic in nature, then some sort of a caching mechanism should be implemented.
  8. Choose an API for dynamic applications that is the fastest and most suitable. While cgi meets most users needs and is easy to program in, a high number of requests can make cgi an expensive alternative. FastCGI and Apache's mod_perl provide persistency as well as increased performance.
  9. If your log files are not really important then you should disable it by commenting our the log lines in the configuration file. This will also improve performance.

So while apache can see an increase in its performance by playing with the various parameters, the biggest bottlenecks continue to be external to the web server and which the web server has no control over. Dynamic elements and cgi scripts some the ones that affect the performance of Apache the most.

Back to Tech Support Topics

 
site by: DWM
©2006 Web Hosting Logic