redis 日常使用

每隔1秒ping3次
[redis@redis01 ~]$ redis-cli -h 192.168.20.201 -p 7003 -i 1 -r 3 ping
PONG
PONG
PONG

  

模拟复制进程
[redis@redis01 7001]$ redis-cli -h 192.168.20.201 -p 7002 --slave
SYNC with master, discarding 176 bytes of bulk transfer...
SYNC done. Logging commands from master.
"PING"
"PING"
"SELECT","0"
"set","a","haitian"
"PING"
"PING"
"PING"
"PING"

别的回话执行的命令在窗口输出就可以显示出来
查找大的键值,可能是系统瓶颈
[redis@redis01 7001]$ redis-cli -h 192.168.20.201 -p 7002 --bigkeys

# Scanning the entire keyspace to find biggest keys as well as
# average sizes per key type.  You can use -i 0.1 to sleep 0.1 sec
# per 100 SCAN commands (not usually needed).

[00.00%] Biggest string found so far 'a' with 7 bytes

-------- summary -------

Sampled 1 keys in the keyspace!
Total key length in bytes is 1 (avg len 1.00)

Biggest string found 'a' has 7 bytes

1 strings with 7 bytes (100.00% of keys, avg size 7.00)
0 lists with 0 items (00.00% of keys, avg size 0.00)
0 hashs with 0 fields (00.00% of keys, avg size 0.00)
0 streams with 0 entries (00.00% of keys, avg size 0.00)
0 sets with 0 members (00.00% of keys, avg size 0.00)
0 zsets with 0 members (00.00% of keys, avg size 0.00)

  

测试网络延迟
[redis@redis01 7001]$ redis-cli -h 192.168.20.202 -p 7001 --latency
min: 0, max: 30, avg: 0.62 (621 samples)^C
[redis@redis01 7001]$ redis-cli -h 192.168.20.202 -p 7001 --latency
min: 0, max: 109, avg: 0.92 (2791 samples)^C
实时获取Redis的重要统计信
[redis@redis01 7001]$ redis-cli -h 192.168.20.202 -p 7001 --stat
------- data ------ --------------------- load -------------------- - child -
keys       mem      clients blocked requests            connections          
0          2.01M    1       0       6259 (+0)           55          
0          2.01M    1       0       6261 (+2)           55          
0          2.01M    1       0       6263 (+2)           55          
0          2.01M    1       0       6265 (+2)           55          
0          2.01M    1       0       6267 (+2)           55  

 

查看内存使用
192.168.20.202:7001> set c haitian
OK
192.168.20.202:7001> memory usage c
(integer) 52

  

 

  

 

转载于:https://www.cnblogs.com/omsql/p/11535933.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值