redis.log

启动:   redis-server /etc/redis.6379.conf

连接:   redis-cli -h localhost -p 6379

关闭:   redis-cli -h localhost -p 6379 shutdown

 

redis服务器性能检测: 50个client,总共10000个请求

redis-benchmark -h localhost -p 6379 -c 50 -n 10000

 

实时输出客户端请求明细:

redis-cli -h localhost -p 6379 monitor

 

根据一定行数的日志分析redis服务状态

redis-cli -p 6379 monitor | head -n100000 > monitor.txt

/data/redis-faina-master/redis-faina.py monitor.txt

    a) [redis-faina]下载

    https://github.com/Instagram/redis-faina  (Python 2.6)

    https://github.com/Instagram/redis-faina/archive/master.zip

    b) [redis-faina]依赖的[rargparse]下载

    http://argparse.googlecode.com/files/argparse-1.1.zip

 

redis服务器实时状况:

redis-cli -h localhost -p 6379 info

redis-cli -h localhost -p 6379 info | grep used_memory

redis-cli -h localhost -p 6379 info | grep connected_clients

 

 

慢日志相关: (需要登录redis-cli) 

单位:微秒 (1秒 = 1000毫秒 = 1000 * 1000微秒)

    记录所有查询时间大于 1000 微秒的查询:

    CONFIG SET slowlog-log-slower-then 1000

    查看 记录大于多长时间的日志

    CONFIG GET slowlog-log-slower-than

    查看 允许记录的最大日志的数量

    CONFIG GET slowlog-max-len

    查看慢日志:

    SLOWLOG GET

 

参考文档:

1. http://dmouse.iteye.com/blog/811455

2. http://blog.nosqlfan.com/html/3971.html

3. http://manual.csser.com/redis/server/slowlog.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值