Although you can go a long way to increase the speed of your solution by tweaking and tuning your code and database schemata, there is a physical limit that can only be overcome by upgrading the hardware that runs your code. Fortunately this is a little less trial-and-error than code tweaking, which means I am able to give you this list of ideas to get you started:

  • Having a dual-CPU machine (or more) makes an enormous difference. I would rather have a dual-1.5GHz machine than a single 3GHz.

  • I have seen no evidence to show that expensive chips incorporating SSE3, Hyperthreading, or even AMD64 extensions provide any meaningful benefit for Apache web servers. There are some benefits to be gained in using 64-bit chips for your MySQL server, though.

  • The amount of RAM you have depends on how much you use your database, but regardless do choose the fastest type available: 533MHz RAM is highly recommended.

  • Hard disks are not all that important in high-performance web sites, as most of the data is stored in RAM. However, if you must load from disk, RAID-linked SCSI drives are recommended. For those on a lower budget, Western Digital's Raptor S-ATA series is remarkably good. For those on a very low budget, normal S-ATA hard disks linked together with RAID will do.

  • Resist moving from one machine to two until it becomes financially necessary. I would rather have one 3GHz machine than two 2GHz machines, for it reduces administration and points of failure, and also eliminates any network bottleneck issues that arise when two computers need to communicate.

  • When you network, Gigabit Ethernet is essential, preferably with each machine connected directly to a switch. Good switches come with an extra port for an intrusion detection computer to monitor the flow of traffic - this is essential for truly secure operation.

  • Using a round robin DNS system is a simple load-balancing system. When a request for comes in, it is randomly sent to one of your farm of web servers. Be careful with sessions, however: if you aren't using databases for session data, it will be stored on the server and therefore lost if the user is transferred to another machine.

  • Blade servers are a cheap and efficient solution for web server systems, but not for SQL servers. The issue is that although they invariably come with a lot of processing power, their hard disks are equally invariably poor.

  • If you are able, set up one machine as a reverse proxy for your site. Reverse proxies essentially store a static cache of your site, refreshing when appropriate. This allows you to keep the load off your dynamic servers, which is ideal for extremely popular sites.

  • You can even have your reverse proxies update their cache every request, which means that the request response sent out by your main web servers are passed by high-speed Ethernet to your reverse proxies, and they then drip-feed that out across the Internet. This is a very easy way to free up your web servers for more important tasks.


Next chapter: PHP Accelerators >>

Previous chapter: Know MySQL's strengths

Jump to:


Home: Table of Contents

Follow us on or Twitter

Username:   Password:
Create Account | About TuxRadar