查看redis客户端连接
1
2
3
4
5
6
|
redis-cli info clients # Clients connected_clients:6000 client_longest_output_list:0 client_biggest_input_buf:5792 blocked_clients:0 |
查看redis 客户端状态
1
2
3
|
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:表示连接存在的时间,单位秒
idle:表示连接空闲时间,单位秒
查看redis客户端超时设置
1
2
3
|
redis-cli config get timeout 1) "timeout" 2) "0" #0表示不开启空闲清除 |
设置空闲清理时间
1
|
redis-cli config set timeout 600 |