Memcached Service

Memcached is an in-memory key-value store used for caching by many web applications and frameworks. It is available in Helion Stackato as a service which can be shared by application instances.

Using the Service

As with other data services, the location and port of the memcached service is exposed to the application via environment variables: STACKATO_SERVICES, VCAP_SERVICES, or MEMCACHED_URL.

The easiest way to connect an application to a Memcached service is to use the MEMCACHED_URL environment variable. It contains the location and port of the service created for the application. For example:



The memcached binary bundled with Helion Stackato does not support SASL authentication, so the memcached_node sasl_enabled setting should remain set to false (default).

Django Example using Memcached

The Django GTD sample application uses the simpler VCAP_SERVICES method for connecting to the Memcached service without authentication.

The relevant configuration in this example:

  1. Specifies the location of memcached using the MEMCACHED_URL in

    CACHES = {
        'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': os.getenv('MEMCACHED_URL'),
  2. Adds the cache to middleware classes:

  3. Adds the python-memcached module and a Memcached service in manifest.yml:

        - python-memcached
        memcached-gtd: memcached