lua-resty-redis icon indicating copy to clipboard operation
lua-resty-redis copied to clipboard

Connection pool not creating

Open first-mine opened this issue 2 years ago • 2 comments
trafficstars

`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 ?

first-mine avatar Jan 26 '23 17:01 first-mine