You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to make sure that connection pool is created ???
For testing purpose kept the pool_size as 1, so that the same connection get reused.
But every time the red:get_reused_times() returns 0, that means new connection getting created everytime, instead of using the existing pool.
Is their any issue with the code ?
The text was updated successfully, but these errors were encountered:
@zhuizhuhaomeng I have tried that, using set_keepalive returning closed for every subsequent request.
The issue I am trying to solve here is, ERR max number of clients reached
This error is coming due to large number of redis connection in my application.
So, I thought creating a connection pool with backlog, would queue up those extra requests to process later instead of throwing that error.
`local red = redis:new()
red:set_timeout(10000)
local options_table = {}
options_table.pool_size = 1
options_table.backlog = 1
local ok, err = red:connect(redis_endpoint, redis_port, options_table)
ngx.say("reused times: ", red:get_reused_times())`
How to make sure that connection pool is created ???
For testing purpose kept the pool_size as 1, so that the same connection get reused.
But every time the red:get_reused_times() returns 0, that means new connection getting created everytime, instead of using the existing pool.
Is their any issue with the code ?
The text was updated successfully, but these errors were encountered: