redis-py icon indicating copy to clipboard operation
redis-py copied to clipboard

Versions 5.3 an 6 are leaking?

Open sbrunner opened this issue 5 months ago • 5 comments

The ram usage of by application in my dashboard:

Image

Did I miss something?

sbrunner avatar Jun 10 '25 10:06 sbrunner

Hi @sbrunner , Could you provide more information about your Redis and redis-py usage? In particular, the following details would be helpful to understand the situation better:

  • Do you know if you use hiredis-py? If so, please specify the version
  • Do you use RESP3 or RESP2 protocol?
  • Is client-side caching enabled?
  • What commands are typically executed by your application?

uglide avatar Jun 10 '25 10:06 uglide

I use Redis server hosted by Asure (single instance, version 7.0.11).

  • I don't use hiredis-py.
  • About RESP3 or RESP2 protocol, I never cared about that, can it have an influence?
  • I don't use client-side caching.
  • I regularly send messages through PUB/SUB channels.

sbrunner avatar Jun 10 '25 12:06 sbrunner

cc @vladvildanov @petyaslavova

uglide avatar Jun 11 '25 11:06 uglide

Hi @sbrunner, can you please provide short explanation how are you using the pubsub? Are you just sending messages, or you also have some handling for received messages? All the information you can provide will be helpful! I'll try to build a test code to reproduce the problem, but I need more details about what should be included. Thanks!

petyaslavova avatar Jun 13 '25 12:06 petyaslavova

Oh, I encountered the same issue. I'm using redis-py in a Flask web application, and after upgrading from version 5.2.1 to 6.0.0, a memory leak occurred.

Image

My use case is fairly simple:

  • Basic Redis commands such as get, delete, setex, ttl, and rpush (e.g., redis.get() and similar)
  • Celery ~~(although it might not be using redis-py directly)~~

I've decided to downgrade back to version 5.2.1 until the issue is resolved. Version 5.2.1 still works without any issues.

sasanquaneuf avatar Jun 15 '25 15:06 sasanquaneuf

I probably related to another dependency because now with the same version of Redis it's ok for me, what about you @sasanquaneuf?

sbrunner avatar Jul 03 '25 14:07 sbrunner