Closed beibei198918 closed 5 months ago
redis-plus-plus does not have a background thread to close these idle connections. Instead, it reconnects the connection when you use it to send a command.
So, the next time, you send some command with an idle connection, redis-plus-plus will close it, and create a new connection to send your command.
Regards
redis-plus-plus does not have a background thread to close these idle connections. Instead, it reconnects the connection when you use it to send a command.
So, the next time, you send some command with an idle connection, redis-plus-plus will close it, and create a new connection to send your command.
Regards
Is there a way to reduce idle connections?
You can config Redis server to make it close idle connections. Check the timeout config in redis.conf:
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
Since there's no update, I'll close this issue.
Regards
Describe the problem I used connection pool: pool_options.connection_idle_time = std::chrono::milliseconds(1000*10); After executing the command, the connection was idle for 2422 seconds, but netstat still checked and the connection was not disconnected. What is the problem?
Environment:
Additional context Here is the relevant code: sw::redis::ConnectionOptions connection_options; connection_options.host = "x.x.x.x"; connection_options.port = 6379; connection_options.password = "aaaa"; connection_options.socket_timeout = std::chrono::milliseconds(200);