Caching: Modules that make Drupal scale

You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

There are many ways to improve the performance & scalability of Drupal.

Comparison of a selection of performance and scalability modules:

Note: This is a partial list including only the most popular modules.

Modules
(order by usage stats)
Releases Cache type Performance gain* Anonymous / authenticated users** Shared / VPS / dedicated / multiple servers*** Maintained Documentation
1. System Required core module Database Moderate All, mostly anonymous All Yes Handbook page
2. Boost 5.x, 6.x, 7.x Direct file cache (.htaccess bypassing php & db) for anon. users Very high Anonymous All yes 7.x handbook, 6.x handbook
3. Javascript Aggregator 5.x, 6.x File Moderate All All Yes ?
4. Cache Router 5.x-beta, 6.x-rc Database, file, PHP opcode, memory Moderate to very high, depends on combinations of options Depends on options All, depends on options Yes In the project page
5. CSS Gzip 6.x File Moderate All All Yes ?
6. Memcache Storage 7.x, 8.x Memory High All VPS, dedicated or multiple Yes In the project page
7. Memcache API and Integration 6.x, 7.x, 8.x Memory High Mostly anonymous VPS, dedicated or multiple Yes In the project page
8. CacheExclude 6.x, 7.x Database Moderate Anonymous All Yes ?
9. Block Cache Alter 6.x, 7.x Database Moderate All All Yes ?
10. Term Lower Name 6.x Database Moderate All All Low activity ?
11. Path Cache 6.x Options Moderate All All Low activity README.txt
12. Authcache 6.x-1.0-rc2, 7.x-2.0-beta3 Database, file, PHP opcode, memory Moderate to very high, depends on combinations of options All, mostly authenticated All, depends on options Yes In the project page
13. Block Cache 5.x-dev Database Moderate All All Yes ?
14. Previous/Next API 6.x-dev Database Moderate All All Low activity Project page, article
15. Varnish 6.x, 7.x-beta, 8.x-dev Reverse proxy (virtual memory) Very high All, mostly anonymous VPS, dedicated or multiple Experimental Issue on Varnish & Project Mercury
16. Advanced Cache 5.x, 6.x-dev Database Moderate Mostly authenticated All Yes In the project page
17. fastpath_fscache 4.7.x-dev, 5.x-rc, 6.x-dev File cache (bypassing database) for anon. users High Anonymous All Yes Drupal issue
18. Ajaxify regions 6.x Database Mostly authenticated All Yes ?
19. Turbo 6.x. Options
20. Cache Graceful 6.x, 7.x, 8.x-dev Graceful (cache backend independent) Moderate to high (concurrent load scaling) Depends on usage All Yes In the project page
21. File Cache 7.x File High All All Yes
22. CDN 6.x, 7.x
23. Speedy 7.x
Other Modules
(not in above list)
Releases Cache type Performance gain* Anonymous / authenticated users** Shared / VPS / dedicated / multiple servers*** Maintained Documentation
1. Entity cache 7.x Database Moderate All Yes Yes ?
2. Panels Page Cache 6.x, 7.x Database Moderate All Yes Yes ?
3. Panels Hash Cache 6.x, 7.x Database Moderate All Yes Yes ?
4. Advanced Panels Cache 6.x Database Moderate All Yes No ?

Notes

(*) Performance gain is moderate for the default database cache, and usually high for file, PHP opcode, proxy and memory caches if affecting most data. The use of cache reduces PHP processing and/or database querying, and therefore increases speed, performance and scalability. Very high means it skips PHP/Drupal completely (Boost, Varnish). Also, combining several high performance caches can give a very high performance gain; for example, APC+Memcache or Cache Router, accelerating PHP with a PHP opcode cache and skipping the database with a fast memory cache.

(**) Often, two or more complementary caches can be used at the same time, for anonymous and authenticated users.

(***) File and database caches can be used with all hosting types, including shared. PHP opcode, proxy and memory caches can be used with VPS, dedicated or multiple servers; shared hosting accounts usually have not enough control for them. Among other possible configurations, especially suitable caches are for example: file for shared, PHP opcode for VPS and dedicated, and proxy and memory for multiple servers.

Descriptions

  • Authcache offers page caching for both anonymous users and logged-in authenticated users. It uses now the standard database cache by default, but it can have a recommended modular integration with cache handler modules such as Cache Router or Memcache, to improve the performance results.
  • Boost provides static page caching, using .htaccess to completely bypass PHP and database for anonymous users. This gives excellent speed and performance similar to those of static HTML sites, which servers such as Apache can easily handle at high rates of hundreds of requests per second. Like webhosts often say, that rate falls to a few requests per second when using dynamic content (PHP, etc.). See Static Page Caching for Drupal, with performance graphs comparing standard database cache and static page cache.
  • Cache Router supports the following technologies, with rewritten code from other modules: database cache, file cache (fastpath_fscache), PHP opcode cache (APC, eAccelerator, XCache), memory cache (Memcache). See Drupal caching with Cache Router.
  • fastpath_fscache is a file-based caching mechanism that replaces Drupal's page cache, bypassing the database for anonymous users. See the Drupal issue File-based caching about its development.
  • Memcache includes an API for using Memcached and the PECL Memcache library with Drupal. It decreases database load by storing objects in memory.
  • Pressflow is not a module, but a derivative of Drupal core providing enhanced performance, scalability, and data integrity.
  • Throttle is an optional core module for congestion control. It has been removed from Drupal 7.x-dev.
  • Varnish is an experimental module for integration between Drupal sites and the Varnish HTTP Accelerator, a fast caching reverse proxy, which stores data in virtual memory (RAM & disk). It's part of the Project Mercury (Pressflow + Varnish) being discussed at Drupal's High performance and Pantheon groups, and at Chapter Three.
  • xCache Cachepage This module provides an alternative cache.inc file to serve anonymous page requests from xCache. This module makes use of DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE and implements page_cache_fastpath().

Modules for monitoring and troubleshooting

Performance benchmarks

See also

To do

List of requirements of each package: memory, etc...
Degree of difficulty
Maturity
DoD

Additional modules

Static html file generation - Anonymous users only:
http://drupal.org/project/cachestatic (abonded in favor of boost)
http://drupal.org/project/html_export
http://drupal.org/project/savetoftp

Several cache technologies:
http://drupal.org/project/cache

Caching of pages in DB:
Drupal's core cache