There are several configuration which will enable apache to perform better and able to handle more traffic.  First up all the web administrator should analyse his entire production environment. This will help him to optimise all the settings, sometimes if your DB is not performing as per the traffic of the webserver, then there is no use of optimising the Apache.

In one of my production environment, my apache servers were hanging after a certain period . Later i found that the problem was not with the apache servers, the bottleneck was with my MySQL. The problem occured because my MyIsam DB was locking the quries and the front enf webservers were not able to free up the  threads. We solved the problem by optimising the quries, There were some quries using SELECT * From the entire table which was almost 2GB.

We have implimented the following mechanisam to handle more traffic.

1) Installed and Configured Memcached

This will help you to cache through PHP and will reduce a lot of traffic in your DB.  90 % of my traffic is now handled by memcached.

2) PHP accelerator

We have installed and configured PHP accelerator in the webservers. and given 32 MB for caching php executions. After implimenting PHP accelerator, the load on the webservers, reduced by almost 70%

3) Installed and Configured mod_deflate on Web Servers

Mod_ deflate will save a lot of bandwidth of your web servers. This module will compress the content before transfering .

There are lot more we did for optimization of our entire production systems. Now we are handling almost .5 millions pageviews per day.

Post By Editor (2,827 Posts)

Website: →

Connect