Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove idle connections periodically #2992

Open
isbee opened this issue Oct 8, 2023 · 0 comments
Open

Remove idle connections periodically #2992

isbee opened this issue Oct 8, 2023 · 0 comments

Comments

@isbee
Copy link

isbee commented Oct 8, 2023

Related issue: #445

If application executed lot's of concurrent commands due to peak traffic, redis-py creates lot's of connections with upperbound max_connections. The problem is these massive connections are not reaped off by redis-py even though peak traffic is gone.

Currently we can leverage redis node's timeout, so a socket is closed on the server side if it is idle and the client can notice this and close this socket gracefully. But I think this is very low level and tricky because someone can forget or misconfigure timeout on redis, but the impact will be huge if peak traffic occurs.

It'll be better that redis-py support max_idle, min_idle like other redis client(e.g. Lettuce, Jedis, go-redis, ...). So developer can notice this, configure as they needed, reap idle connections automatically by redis-py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant