Optimize that Old Server!For one of my fourth year Statistics courses, I did my final group project on the analysis of server-side web page generation time for two different Content Management Systems. We looked at 6 different factors that would affect the generation time to see what the optimal levels should be. For each factor, we considered 2 levels (a 2^6 full factorial experiment).  The factors are as follows:

  1. CMS (Drupal vs Joomla)
  2. Apache version (1.x vs 2.x)
  3. PHP version (PHP4 vs PHP5)
  4. MySQL Caching (on vs off)
  5. FastCGI (on vs off)
  6. eAccelerator (on vs off)

The experiment was run using a PERL script on a dedicated server whipped up by my group partner and skipping past the math/statistics mumbo jumbo, we came to the following result:

Results
The first four factors listed above had a negligible effect on page generation time. The only significant effects were:

  • Using FastCGI saves about 60 milliseconds.
  • Using eAccelerator saves about 70 milliseconds.
  • Using both together saves an additional 11 milliseconds.

Without using FastCGI/eAccelerator, the average page load time was about ~170 milliseconds. Using both, the page load time was only ~20 milliseconds. That is an 88% decrease in page generation time!

eAcceleratorYou can save 150 milliseconds… big whoop right? Well a single server that can serve a page over 8 times as fast as a regular server can pretty much do the same job as 8 separate servers combined. This leads to tremendous cost savings even if the end user doesn’t notice much of a difference.

How to Check if you have eAccelerator/FastCGI Enabled
If you’re with a web hosting company, they will most likely have at least one of these enabled (to reduce costs of course). To check, you can do a simple phpinfo command:

  1. Create a blank php file (i.e. testpage.php)
  2. Put the following line of code in the file:
  3. <?php phpinfo(); ?>

  4. Upload and navigate to that page on your browser.
  5. Voila! Your server’s PHP configuration! Just do a search for eAccelerator and FastCGI to see if it’s enabled.

Conclusion
If you’re hosting sites on your own private server, the optimal configuration, regardless of CMS, Apache or PHP versions is to have FastCGI and eAccelerator installed! Of course, this is not the only way to optimize your server — just two ways I looked at for this project (notice the title of this post is “An” optimal configuration, not “The” optimal configuration). Conclusions can be generalized across different web host with further experimentation.

I’d like to hear how everyone optimizes their own servers so leave a comment!

Popularity: 3% [?]

Leave a Reply