Last updated January 30, 2014. Created by juan_g on October 27, 2008.
Edited by erikwebb, espurnes, OMD, nerdcore. Log in to edit this page.

In order to maximize performance of Drupal we need to understand all the spokes in the wheel that makes it run. Drupal is comprised of many layers that all come together, many of which are outside of the software itself. At the very basics there are two main types of traffic that Drupal can receive, each with very distinct performance attributes. It's important to understand the type of site you have and the type of users coming to your site.

  1. Anonymous Traffic
  2. Lighter user, basic configuration and performance tuning should handle more use cases.

  3. Authenticated Traffic
  4. Heavier user, can lead to more complex configurations to handle load and performance.
    Please see the section below on on Authenticated Users.

Basic configuration

Drupal offers basic performance tuning at:
Administration > Configuration > Performance > Development > Performance (admin/config/development/performance)

It is recommended that block and page caching be enabled. Instead of Drupal dynamically performing complex SQL queries it caches these for quick retrieval.

If you enabled caching, remember, you may need toFlush Cache (Clear all caches button) to see any changes made to your site. The Devel module makes this option part of your top menu for quick cache flushing. If you're a more technical user look atDrush. You can flush cache with one shell command drush cc all.
Typically during developing (on dev), caching should be disabled. On production sites, caching should always remain enabled for best performance.

Page and block caching is not always available. For example, page caching will not be available when a component of the page has marked the page as explicitly not cacheable, such as using sessions. Block caching will not be available when using a module that utilizes node access, such as Organic Groups or Taxonomy Access Control Lite.

Performance Areas

Opcode Caching (PHP - high CPU)

PHP out of the box is a dynamic language and can lead to heavy CPU usage on web servers. There are multiple types of opcode caching add-ons for PHP available that will convert your .php page into memory (byte code) to provide a major benefit in load time and reduced CPU usage. Each of these will require root access to install and have their own specific configurations that will need some attending before using. Once configured and enabled they can provide a substantial benefit to a slow site and greatly reduce CPU usage from PHP.

Wikipedia has full list of other Opcode cache technologies for PHP.

Database Caching

Web Server (Proxy) Caching

Authenticated Users

Performance Modules

If better optimization is required, you might install one or two performance modules. For example, if the site is on a shared server, try Boost (static page caching for non-logged in visitors), complemented with Authcache -in CR's file or db mode- or Advanced Cache (for logged in members). If on a VPS or dedicated server, there are several suitable options: Boost (for example on a low RAM VPS), Authcache, Cache Router (which includes , Memcache...), Varnish, etc. Memcache (or Memcache Storage) and Varnish are also especially suitable when load-balancing multiple servers.

For extensive and detailed information, and more options on server optimization for Drupal, see the following selection of resources.

Drupal performance resources

Information and tutorials on optimizing Drupal's performance, speed, and scalability.

General Drupal performance

At drupal.org:

  • High performance - Drupal group dedicated to solutions and approaches for high traffic, high performing Drupal sites.
  • Modules: Performance and Scalability - Contributed modules: Advanced cache, Authcache, Block Cache Alter, Boost, Cache browser, CacheExclude, Cache Router, CSS Gzip, Javascript Aggregator, Memcache, Path Cache, Term lower name, Varnish, etc. The list can be ordered by usage statistics, last release...
  • Caching: Modules that make Drupal scale - Wiki page for comparison of performance and scalability modules.
  • Server tuning considerations - Detailed collection of HowTo pages.
  • Compatible with Memcache module? - Boost module issue including a solution to use several performance modules working together for logged in and non-logged in users.
  • System: cron and caching - System, a required core module, provides system-wide defaults for storing (caching) web pages to improve efficiency, and performing other essential tasks.
  • Throttle: congestion control - Throttle, an optional core module, provides a congestion control throttling mechanism for automatically detecting a surge in incoming traffic.
  • Drupal guide to caching [draft 1] [2] - Preliminary versions, by Steve Dondley, for an introduction to the various caching mechanisms Drupal 6 uses to speed the site.
  • Coding Standards and Performance Optimization - Group for Drupal developers, on optimized PHP coding.
  • Performance and scalability - Deprecated forum with old threads; for current discussions see the two performance groups, specially High Performance for Drupal sites.
  • Load Testing Drupal - A module that generates customized Apache JMeter and Selenium test scripts for any Drupal installation. These scripts are ready to run as part of a load test on a load testing cloud provided by BlazeMeter.

Other resources:

Videos, screencasts and slideshows

At drupal.org:

Other resources:

Case studies

At drupal.org:

Other resources:

Monitoring and troubleshooting

At drupal.org:

Other resources:

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

That’s quite useful information though. A lot of information I have read over the web regarding the potential optimization of the Drupal app, but haven’t yet read anything similar to this. Good work guys! We get a lot of queries on the performance optimization of the Drupal site; hence, we drafted a post on some essential tips that help a user to optimize the performance of their website hosted on Drupal.

Sub-Editor @Cloudreviews

The "Caching and performance improvements - Video and article from Drupalcon Szeged 2008" session has moved to http://szeged2008.drupalcon.org/program/sessions/caching-and-performance...
and the video is here http://archive.org/details/PerformanceCaching

I see I can edit the text so I will change the link there.