Al Jazeera

What they needed

Al Jazeera’s blog site was a stable but growing Drupal project until protests in Tunisia and Egypt caused a huge increase in traffic. A Drupal installation on a server with no performance related tuning suddenly needed to stay up under huge increases traffic, as Al Jazeera’s audience tried to keep up with rapidly unfolding events.

How we helped

Working under the requirement that the site not be down for more than 5 minutes at a time, Four Kitchens’ web chefs worked through the night to upgrade the Drupal installation to Pressflow, install the Varnish reverse proxy cache, and do what MySQL tuning could be done without incurring the downtime of dumping and recovering the database.

Project outcome

The Al Jazeera blogs site remained up through a week of rapidly unfolding events and record traffic. A successful transition to hosting better suited to the long term traffic could then be arranged.

The standard Drupal “server stack” consists of Linux, the Apache web server, the MySQL database, and PHP (running Drupal). On most distributions of Linux, these components will have default “lowest common dominator” configurations that will run the widest variety of applications; this makes the out-of-the-box install most useful to the most number of people.

Drupal and each website running it use these components in particular ways that are sometimes far from the “lowest common denominator.”

The single most effective change that can be made to an out-of-the-box Drupal site under high load is to install the Varnish reverse proxy cache. This was one of the first things done for Al Jazeera’s blogs. Drupal normally sets a unique session cookie for each visitor, and this would cause Varnish to keep a separate cache for each user; the Pressflow distribution of Drupal does not do that for users that are not logged in to the site, and is necessary for using Varnish.

Thus the first and most effective change done to the blogs site was to replace Drupal with Pressflow, and then put Varnish between Apache and the end user. For most sites in an emergency situation, this will be the most effective single thing they can do. (If most users are logged in, for example a site on which most users post comments, Varnish will not help as much.)

In Al Jazeera’s case making this modification was possible because the total downtime can be short, only the amount of time needed to restart the Varnish and Apache daemons and run update.php.

Another performance enhancement that requires little downtime is install memcached and configure Drupal to use it for it’s internal cache tables; however this mostly helps the performance for logged-in users.