CACHE settings (Redis or Memcached) for Tutor Plugins

@regis This question is in regards to configuring the CACHES for tutor plugins for edX IDAs. Should we setup the plugin to use Redis instead of memcached. When we setup our edX IDA using the cookiecutter repo mentioned below we had LocMemCache Django CACHE setting and separate memcache Docker container setup. It seems like the IDA should be pointing to django_redis.cache.RedisCache for CACHES Django setting based on what I’m seeing with how the LMS is configured within Tutor. Please advise.

Also I don’t see anywhere in Tutor documentation to use external services like AWS ElasticCache for Redis. Not sure if we’re supposed to use that seeing that Tutor sets up redis and redis-permissions Docker containers. I realize you have the RUN_REDIS condition so you don’t have to install Redis in a container if you don’t want to. The question is what will happen if you don’t and use AWS ElasticCache for Redis instead? Have you tried this out?

{% if RUN_REDIS %}
    image: {{ DOCKER_IMAGE_REDIS }}
    working_dir: /openedx/redis/data
    user: "1000:1000"
      - ../apps/redis/redis.conf:/openedx/redis/config/redis.conf:ro
      - ../../data/redis:/openedx/redis/data
    command: redis-server /openedx/redis/config/redis.conf
    restart: unless-stopped
      - redis-permissions
    command: ["1000", "/openedx/redis/data"]
    restart: on-failure
      - ../../data/redis:/openedx/redis/data
  {% endif %}

Looking at Tutor configuration for the LMS platform it uses Redis mostly with the exception of the staticfiles_lms.

The platform code uses MemcachedCache mostly for maple.

When we setup our IDA it comes by default setup based on the cookiecutter configuration.

Django CACHE settings use LocMemCache.


# See:
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',

Docker Container Memcache setup:


    image: memcached:1.4.24
    container_name: {{cookiecutter.project_name}}.memcache

Hi @ztraboo ,I have not used AWS ElasticCache before, is it compatible with Redis interface? if the answer is yes, you should be able to use it instead of running a Redis container. You have to configure REIDIS_HOST/REDIS_PORT/REDIS_USERNAME/REDIS_PASSWORD properly.

1 Like

@pcliu It seems that it’s open source Redis with scalability. I haven’t dug into configuration on AWS ElasticCache or MemoryDB.

I guess that we also need to be concerned with message broker replacement of RabbitMQ with Redis as Tutor uses I think. AWS ElasticCache does that too.

Tutor does not run Memcache out of the box. If you wish to add it to your stack, then you should include the service in your plugin.
I have no reason to believe that Tutor does not work with ElasticCache, although I never tried to use it myself. However, I was once told that ElasticCache does not offer on-disk persistence, which means that you would lose all scheduled tasks in the case of an AWS crash: see this conversation from one year ago on Slack.

1 Like