Open first-mine opened 1 year ago
did you call the set_keepalive to put the connection to the pool?
Yes, set_keepalive is there after connect. local ok, err = red:set_keepalive(1000000, 100)
Even if set_keepalive wasn't there. It shouldn't have created 5 connection. Right ?
Please show your code that can reproduce the problem
@zhuizhuhaomeng One more observation I found. For red:publish command, new connection is opening every time, I have called the set_keepalive. But for other operations like get, set, lpush, etc the same connection getting reused. Is this a bug or is it supposed to be like this ??
I have tried creating a connection with pool_size = 1 and backlog=10 but every concurrent request creating new connection.
For 5 concurrent request this is the output. netstat | grep redis tcp 0 0 app-server:15174 app-redis-:6375 ESTABLISHED tcp 0 0 app-server:14600 app-redis-:6375 ESTABLISHED tcp 1 0 app-server:2666 app-redis-:6375 CLOSE_WAIT tcp 0 0 app-server:15156 app-redis-:6375 ESTABLISHED tcp 0 0 app-server:15158 app-redis-:6375 ESTABLISHED tcp 0 0 app-server:15170app-redis-:6375 ESTABLISHED
Ideally it should have created 1 connection and queued the rest 4. Right ? Is this a issue from my side?