Reputation: 6872
Can someone let me know the relation between PoolTimeout, IdleTimeout & IdleCheckFrequency in go-redis?
Doubts:-
PoolTimeout
20ms, IdleTimeout
20ms, PoolSize
100 & IdleCheckFrequency
1 min. Let's say all the connection in the pool are used and a connection finishes its operation. Then will the request for a new connection wait till the IdleCheck is run in 1 min interval?PoolSize
100 will the client keep open 100 connections to redis even if there is no active client operation being performed to Redis?Environment:-
Upvotes: 4
Views: 5340
Reputation: 6872
This has been answered in github here. Just posting the relevant parts below:-
PoolSize limits max number of open connections. If app is idle then go-redis does not open any connections.
New connection is opened when there is a command to process and there are no idle connections in the pool. Idle connections are closed after they are idle for IdleTimeout.
IdleCheckFrequency specifies how often we check if connection is expired. This is needed in case app is idle and there is no activity. Normally idle connections are closed when go-redis asks pool for a (healthy) connection.
Upvotes: 5