redis / rueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.
Apache License 2.0
2.46k stars 158 forks source link

Feature: remove idle connections from pool #651

Open rueian opened 4 weeks ago

rueian commented 4 weeks ago

Currently connections in the connection pools (spool and dpool) inside a mux will live forever.

It would be nice if we had an option, such as ConnIdleDuration or a better naming, to clean connections that are idle for a long time to reduce memory usage.

mingdaoy commented 4 weeks ago

Hi @rueian, I'm interested in working on this issue!

abuzaforfagun commented 4 weeks ago

I am interested in working on this issue.

proost commented 3 weeks ago

@rueian Does need option to min size of connection pool? making a new connection is expensive. If all connections is closed, can be harmful to latency sensitive apps. current pool only support cap size.

rueian commented 3 weeks ago

@rueian Does need option to min size of connection pool? making a new connection is expensive. If all connections is closed, can be harmful to latency sensitive apps. current pool only support cap size.

Yes, there should be an option for that.