Replies: 1 comment 1 reply
-
The main reason is that database/sql pool does not have/require the reaper goroutine. So we tried to adopt a similar approach with Min/MaxIdleConns. |
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
-
I read the v8's
pool.go
code and found that there is a reaper() goroutine periodic execute to maintain theMinIdleConns
connections, so when my business code to execute a redis command, the connection taken from the connection pool is high probability have been created by reaper() goroutine, and it can save the establishing time when the redis command execute.But the v9.0.1's CHANGELOG only say: "Removed connection reaper in favor of
MaxIdleConns
.", not to explain how to maintainMinIdleConns
connections. I debugpool.go
and observe that when a redis command execute, in theGet(ctx context.Context)
method, first loop dopopIdle()
, and when all connections is unhealthy, then create an idle connection.So my question is:
Beta Was this translation helpful? Give feedback.
All reactions