Improve the real or perceived speed of the site, or monitor performance metrics.

Cache Dispatcher

UPDATE: Looking at Cache Backport, this module seems somewhat ridiculous ... I have now abandoned it.

Cache Heuristic

Cache Heuristic keeps track of which cache-entries are loaded a page, and bundles the cache loads by taking advantage of Cache->getMultiple(). Resulting in a reduced number of queries to the caching backend.

To enable, add to settings.php:

Drupal 6

NOTE: Requires Cache Backport

<?php
$conf['cache_backends'] = array(
  'sites/all/modules/cache_heuristic/cache_heuristic.inc'
);

$conf['cache_inc'] = 'sites/all/modules/cache_backport/cache.inc';
$conf['cache_default_class'] = 'HeuristicCache';
$conf['heuristic_cache_default_class'] = 'DrupalDatabaseCache';
?>


Drupal 7

<?php
$conf['cache_backends'] = array(
  'sites/all/modules/cache_heuristic/cache_heuristic.inc'
);

$conf['cache_default_class'] = 'HeuristicCache';
$conf['heuristic_cache_default_class'] = 'DrupalDatabaseCache';

// Example: Use memcach for the menu cache
$conf['heuristic_cache_class_cache_menu'] = 'MemCacheDrupal';
?>

Graceful caching

You can mix and match caching backends, e.g. adding graceful caching to the Drupal 7 example above using Cache Graceful


<?php
$conf['cache_backends'] = array(
'sites/all/modules/cache_graceful/cache_graceful.inc',
'sites/all/modules/cache_heuristic/cache_heuristic.inc',
);

CloudFlare

CloudFlare is a FREE reverse proxy, firewall, and global content delivery network and can be implemented without installing any server software or hardware.

On average, CloudFlare-powered websites load 30% faster, use 60% less bandwidth, and process 65% fewer requests. CloudFlare-powered websites are protected from many forms of malicious activity including: comment spam, email harvesting, SQL injection, cross-site scripting, and DDoS (denial of service) attacks.

8.x Features

  • Cache clearing by Tag (Recommended) and Path.
  • Restore client's original IP address.

7.x Features

  1. Corrects $_SERVER["REMOTE_ADDR"] so it contains the IP address of your visitor, not CloudFlare's reverse proxy server.
  2. Integrates with CloudFlare's Threat API so you can ban and whitelist IP addresses from the Drupal Comment administration screen.
  3. Integrates with CloudFlare's Spam API.
  4. Integrates with CloudFlare's Client Interface API (planned).

How do I get started with CloudFlare?

  1. Visit http://www.cloudflare.com to sign up for a free account.
  2. Follow their 5-minute configuration wizard.

commentstatsrebuild

A node I found describes how to do it manually, this is a minimalistic module that adds a button to the admin interface.

Background Process

Drupal 7 Settings

Dependencies


Modules that utilize Background Process


Developer

Executing a background process

<?php
$handle = background_process_start('mymodule_dosomething', $myvar1, $myvar2);

$handle = background_process_start(array('myclass', 'mystaticfunction'), $myvar1, $myvar2);

$handle = background_process_start(array($myobject, 'mymethod'), $myvar1, $myvar2);

$handle = background_process_start_locked('dontrunconcurrently', 'mymodule_dosomething', $myvar1, $myvar2);
?>


Executing arbitrary http requests

The following code shows how to fetch data via http in "parallel" (asynchronous non-blocking mode)
It uses an API similar to that of HTTPRL but "slightly" different, in order for the caller to gain more control of the requests. Plans to join forces with HTTPRL are in place.

Drupal way: blocking/synchronous

<?php
$r = array();
for ($i = 0; $i < 10; $i++) {
  $r[] = drupal_http_request('http://www.example.com/stuff/' . $i);
}
print_r($r);
?>


Pages

Subscribe with RSS Subscribe to RSS - Performance