Drupal Memcache Configuration

Profile picture for user devraj
Submitted by devraj on

To configure Memcache with drupal first you need to install memcache binaries on your server. Here are the steps for Amazon Linux EC2. Once the server is configured follow below steps to use memcache with Drupal.

Step 1: Install Memcache API and Integration module

Step 2: Enable Memcache and Memcache Admin Module

Drupal Memcache Configuration

Step 3: Add below lines in your /sites/default/settings.php file

$settings['memcache']['servers'] = ['' => 'default'];
$settings['memcache']['bins'] = ['default' => 'default'];
$settings['memcache']['key_prefix'] = '';
$settings['cache']['default'] = 'cache.backend.memcache';

Step 4: Navigate to Reports -> Memcache Statistics and make sure memcache is running successfully and your getting hits. Also, misses must not be 100%.

Drupal Memcache Configuration

In case of issue make sure

  • memcache service is running on your server
  • Read the readme.txt that comes with module