Improving Drupal Performance (from the Dallas Drupal Feb meeting)
At last night's Dallas Drupal meeting, Dustin Currie of LevelTen Interactive and Mark Sonnabaum of allplayers.com each gave excellent presentations on improving performance of Drupal websites. I thought I'd briefly recap some of their points here. Most of these tips only apply to production websites, not development.
General Performance Tips
- Simply turn on page cache, page compression, and block cache. Block cache isn't available if modules defining content access restrictions are enabled. Look for these settings in admin/settings/performance (D6).
- If using Apache, enable mod_deflate and you can see an 80% reduction in the size of output from Apache. You'll also need to add some output filters. There are lots of options as well as caveats, but it is worth exploring and learning.
- Aggregate CSS & Javascript. This greatly reduces the number of individual requests made to the webserver. It won't work if you are using Drupal's private files system. admin/settings/performance (D6).
- Use mod_expires and Drupal will send out expires HTTP headers, causing the browser to cache all static files. The setting in the default .htaccess file that installs with Drupal is set for two weeks.
- Use a PHP accelerator, such as eAccelerator, APC, or Zend. Compiled PHP runs much faster. Also of interest is Facebook's accelerator, HipHop.
- Use a CDN (Content Delivery Network) to parallelize HTTP requests. Coming soon- a CDN module for Drupal will make that easier.
- Up-and-coming - use Data URIs, which encodes content inline, removing some HTTP requests. Not well supported yet- esp in IE6 and IE7 (with limits in IE8).
Useful Tools
- Yahoo's YSlow ", a Firefox add-on that "analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages".
- Firebug's Net tab can show you a timeline of file loads.
There was a brief discussion of other performance enhancers, like Varnish and Memcache, Project Mercury and Pressflow. The investigation of these is left as an exercise for the reader. A new book from Packt Publishing just came out entitled "Drupal 6 Performance Tips" that might be useful as well.


