> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring Drupal to use memcached

> To help improve your site's performance, you can configure Drupal to use memcached. Follow these instructions to setup memcached on your Drupal site.

This article describes how to configure Drupal to use memcached.

Memcached is an open-source memory object caching system that web sites can use to help accelerate page load times. Memcached works by caching in RAM frequently accessed data, such as the results of API calls, database calls, and more.

<Note>
  * If you have a managed VPS or managed Dedicated Server, please open a support ticket on the Hosting Panel at [https://my.hosting.com](https://my.hosting.com)and request memcached for your system. We will install it for you.

  * If you have an unmanaged VPS, you can install memcached yourself.

  * Memcached is not supported on non-Turbo shared hosting accounts at this time.
</Note>

## Installing the memcached module

After memcached is installed on your system, you need to install a module so Drupal can access and use it. To do this, follow these steps:

1. Use your web browser to visit [https://www.drupal.org/project/memcache](https://www.drupal.org/project/memcache).

2. Under **Downloads**, download the.gz file to your computer.

3. Log in to your Drupal site as the administrator.

4. On the top menu bar, click **Modules**, and then click **Install new module**.

5. Click **Browse**, select the.gz file on your local computer, and then click **Install**. Drupal installs the memcached module.

6. Under **Next steps**, click **Enable newly added modules**. The **Modules** page appears.

7. Scroll down to **PERFORMANCE AND SCALABILITY**, and then select the **ENABLED** check box next to the **Memcache** and **Memcache Admin** modules.

8. Click **Save configuration**.

9. On the top menu bar, click **Configuration**.

10. Under **SYSTEM**, click **Memcache**.

11. If you want to display memcached-related statistics at the bottom of each page, select the **Show memcache statistics at the bottom of each page** check box, and then click **Save configuration**.
    > 🚧 Important
    >
    > By default, only the administrator can view these statistics, which include fetch times (in milliseconds), total number of cache hits and misses, and more.

## Configuring memcached settings

After you install and enable the memcached module, you are ready to configure Drupal to actually use memcached. To do this, follow these steps:

1. Use your preferred text editor to open the *sites/default/settings.php* file.

2. Copy the following text and paste it into the *settings.php* file:

```
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['lock_inc'] = 'sites/all/modules/memcache/memcache-lock.inc';
$conf['memcache_stampede_protection'] = TRUE;
$conf['cache_default_class'] = 'MemCacheDrupal';

// The 'cache_form' bin must be assigned to non-volatile storage.
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';

// Don't bootstrap the database when serving pages from the cache.
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;
```

<Tip>
  This configuration sets up one memcached instance that stores all Drupal caches in memcache except for cache*form. For additional memcached configuration examples, see the\_sites/all/modules/memcache/README.txt* file.
</Tip>

3. Save your changes to the *settings.php* file. Memcached is now configured for Drupal.

## More information

* For more information about memcached, please visit [http://www.memcached.org](http://www.memcached.org).

* For more information about Drupal's memcached implementation, please visit [https://www.drupal.org/project/memcache](https://www.drupal.org/project/memcache).
