Redis cache Timeout not working

Hi All,
we are running Tutor(v11.2.5) with Koa and the cache config in $(tutor config printroot)/env/app/openedx/config/lms.env.json is as following:

"course_structure_cache": {
      "KEY_PREFIX": "course_structure",
      "TIMEOUT": "7200",
      "BACKEND": "django_redis.cache.RedisCache",
      "LOCATION": "redis://@REDIS_SERVER_HOST:6379/1"
    },

but our Redis DB memory usage reached 99% from 0% in 3 months.
when we checked the cache keys we found the TTL of ‘course_structure’ keys were set to ‘-1’ so our Redis policy(‘volatile-lru’) could not evict the caches.
Anyone has any idea about it?

here’s our code and output for getting keys and their TTL in Redis:
Code:

r = redis.StrictRedis(REDIS CONNECTION INFO)
for key in r.keys():
    if 'course_structure' in key:
      print(key)
      print('ttl='+str(r.ttl(key)))

Output:

course_structure:1:6283d8bd3a4ea8631da9bbaf
ttl=-1
course_structure:1:606cc107909c71f0d70e646f
ttl=-1

Hi @Xuebo,
This forum has moved to https://discuss.openedx.org/. I suggest that you post there to get better answers from cache experts.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.