# Move all cached data (except form cache) to memcache storage.
$conf['cache_backends'][] = 'sites/all/modules/memcache_storage/memcache_storage.inc';
$conf['cache_default_class'] = 'MemcacheStorage';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['cache_class_cache_update'] = 'DrupalDatabaseCache';

# Set PECL extension to communicate with memcached daemon.
$conf['memcache_extension'] = 'Memcached';

# Configure memcached extenstion.
$conf['memcache_options'] = array(
  Memcached::OPT_TCP_NODELAY => TRUE,
  Memcached::OPT_BINARY_PROTOCOL => TRUE,
);

# Store pure HTML for page cache instead of php object.
# Use this config only when you want to reach page cache from nginx or varnish.
$conf['cache_backends'][] = 'sites/all/modules/memcache_storage/memcache_storage.page_cache.inc';
$conf['cache_class_cache_page'] = 'MemcacheStoragePageCache';
$conf['memcache_storage_external_page_cache'] = TRUE;

# Set custom expiration time for cached pages. Together with configured
# Cache Expiration module will relieve the load from your server(s) if you
# have a lot of anonymous users.
$conf['memcache_storage_page_cache_custom_expiration'] = TRUE;
$conf['memcache_storage_page_cache_expire'] = 60 * 60 * 24;  // 1 day.

# Enable debug mode.
$conf['memcache_storage_debug'] = TRUE;

# Add prefix to each cache id.
# Useful when you use the same memcached instance across different web sites.
$conf['memcache_storage_key_prefix'] = 'build-1';

# Add multiple memcached instances.
$conf['memcache_servers'] = array(
  'unix:///var/run/memcached/memcached.socket0' => 'default',
  'unix:///var/run/memcached/memcached.socket1' => 'bootstrap',
  'unix:///var/run/memcached/memcached.socket2' => 'field',
  'unix:///var/run/memcached/memcached.socket3' => 'page',
);

# Set reference between cache bins and memcache server names.
# All other bins will be refered to the 'default' server.
$conf['memcache_bins'] = array(
  'cache_bootstrap' => 'bootstrap',
  'cache_field'     => 'field',
  'cache_page'      => 'page',
);

# Move storage for lock system into memcached.
$conf['lock_inc'] = 'sites/all/modules/memcache_storage/includes/lock.inc';

# Move storage for sessions into memcached.
$conf['session_inc'] = 'sites/all/modules/memcache_storage/includes/session.inc';

Comments

achundunsing’s picture

These advanced configuration are for Drupal 7.
Is there a Drupal 8 updated version ?