Jason Mayes, senior Web development engineer at XMOS Ltd., offers his own top 10 list for dealing with site congestion and other potential server outage problems:
- Optimize your static content. Compress images to get every last kilobyte out of them while retaining visual quality.
- Add “expires” headers to content to prevent browsers from continually downloading the same files as a user browses your Web site.
- Ensure that your Web server delivers content in a compressed state — for example, mod_deflate for Apache. Clearly this should not be applied to files such as images — which are already compressed — so make sure you set up rules correctly.
- Include these files only on the pages where they are required.
- Optimize your content management system. Reduce the number of database calls you need to make for each page request, for example. In Drupal, this can be as simple as disabling modules you do not need. Also, make any custom code more efficient if possible. A change of one-tenth of a second in an algorithm that is run thousands of times adds up.
- Support caching of data that is frequently accessed. Use Memcache or something similar. Many CMS packages support this, but be careful with dynamic data.
- Load-balance your Web server.
- Separate your read/write databases so that you can have a master/slave database setup, allowing your database infrastructure to be scalable.
- If applicable, split your database vertically or horizontally (or potentially a hybrid of these if this model suits your database structure) over several servers. This may not be suitable for everyone, however.