Skip to content

Instantly share code, notes, and snippets.

@dashr
Created March 7, 2011 22:13
Show Gist options
  • Save dashr/859382 to your computer and use it in GitHub Desktop.
Save dashr/859382 to your computer and use it in GitHub Desktop.
only use memcached plugin if memcached responds
/**
* Use Memcached (if its on):
*
* Enable these configurations if a Memcached server is running on the
* server. This will move the database load from MySQL to Memcached,
* increasing the site speed and lowering the database lag.
*
* cache_inc = replaces the Drupal caching mechanism
* session_inc = replaces the Drupal mysqldb Sessions handler
* memcache_key_prefix should be set to a short unique string in multi Drupal environment
*
*/
if (@memcache_connect('127.0.0.1',11211) !== false) {
$conf['cache_inc'] = './sites/all/modules/memcache/memcache.inc';
$conf['session_inc'] = './sites/all/modules/memcache/memcache-session.inc';
$conf['memcache_key_prefix']= 'live';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment