redis Performance Testing and Monitoring

  很多人在安装部署好redis后,就没有对redis的配置和部署等有效性和高可用性进行性能测试最终导致上线出现缓存穿透、雪崩等现象,导致性能还是有问题,其实做为技术运维人员在部署好redis后可以使用redis自带的压测工具进行简易型压测,如下命令:
redis 性能测试的基本命令如下:
redis-benchmark [option] [option value]

     例如我在本地搭建一个redis服务,IP地址是10.100.81.171,这时需要模拟100用户并发链接请求,每个用户现场循环访问100次,
    redis-benchmark -h 10.100.81.171 -p 6379 -c 100 -n 100000
    参数详解:
      1、100000 requests completed in 1.60 seconds     //默认是100000,上面有,请求在1.6s内完成
      2、3 bytes payload,每次写入3个字节的数据
  3、keep alive: 1,保持一个连接,一台服务器来处理这些请求
  4、100.00% <= 2 milliseconds,所有请求2毫秒完成
        5、62656.64 requests per second 每次能处理请求数量

    具体如下图:

redis Performance Testing and Monitoring

redis case pressure measurement read, as follows:
a test access size of 500 bytes packets performance
redis-benchmark -h 10.100.81.171 -p 6379 -q -d 500

redis Performance Testing and Monitoring

Then you can see by monitoring the command or other tools redis service server resources usage:
redis Performance Testing and Monitoring

redis-benchmark 工具命令使用介绍:

redis Performance Testing and Monitoring

Guess you like

Origin blog.51cto.com/372550/2404638