redis client does not release too many connections

View redis client connections

redis-cli info clients
# Clients
connected_clients:6000
client_longest_output_list:0
client_biggest_input_buf:5792
blocked_clients:0

View redis client status

redis-cli client list
addr=127.0.0.1:52555 fd=5 name= age=855 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
addr=127.0.0.1:52787 fd=6 name= age=6 idle=5 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=ping

age: indicates the presence of connection time in seconds

idle: indicates the connection idle time in seconds

View redis client timeout settings

cli-config timeout GET Redis 
1) "timeout" 
2) "0" # 0 means no open idle Clear

Set idle time to clean up

redis-cli config set timeout 600

  

Guess you like

Origin www.cnblogs.com/wowblog/p/10966120.html