1

I am running django app (wagtail) in kubernetes cluster along with redis. These two pieces are connected by django-redis. This is how my backend configuration look

{
    "BACKEND":"django_redis.cache.RedisCache",
    "LOCATION":"redis://redis-service:6379/0",
    "OPTIONS":{
        "CLIENT_CLASS":"django_redis.client.DefaultClient",
        "CONNECTION_POOL_KWARGS":{
            "max_connections":1000
        }
    }
}

This works just fine. I can see keys getting created in redis and app is also blazing fast thanks to redis.

Now real issue is every once in a while app slows down for some time. Upong investigation we found out the real issue is a key of size ~90 MB is created in redis. to process this key app takes some time and slows down.

To put a comparison other keys are less than 1 MB always just 1 key gets randomly created on one type of endpoint but not always.

I tried to check the contents of the key after unpickling and it is normal amounts of data just like other keys. but running

redis-cli --bigkeys

gives output something like this

Biggest string found '":1:views.decorators.cache.cache_page.XXXXXXX.GET.9b37c27c4fc5f19eb59d8e8ba7e1999e.83bf0aec533965b875782854d37402b7.en-us.UTC"' has 90709641 bytes

has someone seen similar issue? Anyway to debug the root cause.

django-redis version "==4.12.1"
wagtail version "==2.11.1"
django version "==3.1.3"

Ojas Kale
  • 2,067
  • 2
  • 24
  • 39

0 Answers0