Replies: 1 comment 1 reply
-
This does not look important enough to introduce a configuration option, but perhaps we can make this a default behavior, e.g. only drop half of the idle conns. Also, we could try to remove periodic Do you have any charts/numbers to share how this affect your program? We don't want to further complicate the pool without a good reason so it would be nice to understand how important this problem is... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have observed that the current pool implementation is very eager on removing idle connections and the stale ones [1]. In some situations we have seen that all idle operations can be drop all or a significant amount at the same time, same for the stale ones. This impacts directly on the latency of the requests, since new inflight requests might be still requiring a portion of the connections that where drop.
We would like to propose the addition of a safe guard or a jitter time for avoiding this kind of situations, which will guarantee that the drop of the connections is done progressively and when there is confirmation that they are no longer required, for keeping compatibility we could introduce a new Pool config option called
minConDropLag
, for making sure that at most 1 connection is dropped - because of timing out the idle time or the stale one - within aminConDropLag
time window. This value could be set to-1
by default meaning not being effective, while0
could mean a default value like 60 seconds.Thoughts?
[1] https://github.com/go-redis/redis/blob/master/internal/pool/pool.go#L266
Beta Was this translation helpful? Give feedback.
All reactions