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
Step 3: Add below lines in your /sites/default/settings.php file
$settings['memcache']['servers'] = ['127.0.0.1:11211' => '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%.
In case of issue make sure
- memcache service is running on your server
- Read the readme.txt that comes with module