[phpa] On optimizing webservers

There's one thing people sometimes forget when they're optimizing their 
websites.

Keeping static contect, such as large media files, and pictures, on a seperate 
box might do wonders for your website, at least response wise.

There are a LOT of things to consider when optimizing a website.  

Here's a list of things I can think of right now:

 * Stripping out modules you don't need
   Loading modules, and supporting stuff you'll never use/need is a complete 
waste of resources.

 * Serving dynamic and static content from either seperate boxes, or at least 
not via the same webserver.
   Performance tuning for static content on one hand, is different from tuning 
for dynamic content.
   The bottleneck for static content is usually I/O and RAM related.
   The bottleneck for dynamic content is usually CPU / DB related.

 * If you're using Mysql, read the optimizing section of the mysql doc. 
Consider using HEAP tables where you can.

 * When using PHP, read about ob_start, compress your output if you can 
(checking out mod_gzip might be a good idea).

 * Use a PHP cache, preferable PHP Accelerator ;)
 
 * If you can get away with it, compile everything with libraries statically 
linked, might boost things by 1-2%

 * Think about installing a proxy in front of your website, e.g. apache + 
mod_proxy, it helps on sites with heavy load.

... I could go on, but I'm running out of time here.

Try to serve as much static content as you can, cut down those DB queries, try 
generating static content where you can.  For example if you have a news page 
that updates every other day, then for crying out loud, don't query the 
database for every request.  Generating a static html-bit and include it would 
help.  It's not that difficult to write a simple script that either updates 
that bit on pre-defined hours.

Again a lot of things to consider, and I'm leaving out a lot of things on 
purpose, and probably forgetting a lot of stuff.  Just RTFM, research online, 
and then RTFM again.  No matter what you do, don't settle for the default 
settings!!!

.. *phew*

My $0.02 for now... :)

regards,

egill
------------------------------------------------------------------------
  www.php-accelerator.co.uk           Home of the free PHP Accelerator

To post, send email to phpa@xxxxxxxxxxxxx
To unsubscribe, email phpa-request@xxxxxxxxxxxxx with subject unsubscribe


Other related posts: