A New Flavor of Drupal for High-Performance Websites

Many of the sites we develop at Brunello receive massive amounts of sustained traffic and huge spikes when content is picked up by syndication. We've stared using Drupal as a CMS for many of our client's sites and have found that, while we love the power, flexibility and scalability of Drupal, it does have some performance weaknesses that could be improved. Enter Pressflow.

Pressflow is slightly tweaked version of Drupal core that improves or expands certain aspects of Drupal's performance. It's important to note that Pressflow is not a fork from Drupal, but rather a flavor with some minor, but key differences. In fact, they're so similar, that you can actually take an existing site built on Drupal 6.16, replace the core files with the equivalent Pressflow core (6.16.77) and it will continue running as though nothing has changed. (of course you should run update.php after swapping the files)

Pressflow addresses three of Vanilla Drupal's performance weaknesses:

  1. Support for legacy software (specifically PHP4)
  2. Lack of external caching and cached pages being served when they should not
  3. Lack of database replication

Drupal is wildly popular as a CMS for personal and small business websites all the way up to large-scale corporate and commercial sites and social networks. The maintainers of Drupal have decided that the best way to keep the CMS appealing for such a wide range of uses is to make it as flexible as possible. This includes maintaining built in support for antiquated software including PHP4. So, for example, where a CMS built exclusively for PHP5.2+ can use PHP's new json_encode function, Drupal must use resource intensive wrapper functions instead.

The second improvement has to do with the caching mechanism built into Vanilla Drupal core. It does a great job of speedily delivering content from a cache table in the DB, but, 1) it's not smart enough to know when delivering a cached page is imprudent and 2) it still requires interaction with most of the software (LAMP) stack. Pressflow improves on these problems with a new small module and added support for external caching. The small module basically checks to see if a user is submitting a comment (or other form) and, if so, will deliver an un-cached version of the page upon submission (so the user can see their results). External caching is achieved through added support of open source project Squid and Varnish (think of sites such as Wikipedia - they use Squid to cache their pages).

Finally, Pressflow adds support for database replication. Using simple syntax in the site's settings.php file, an admin can easily define a master DB and multiple slaves. Generally, writes to the DB will happen only on the master, but queries will be directed to one of the slave DBs - thus spreading around the query workload and freeing up the master for writes only.

We're busy running further tests on Pressflow and look forward to using it on our next site launch.