【Redis】压力测试(redis-benchmark)

Redis自己提供了一个性能测试工具redis-benchmark。redis-benchmark可以模拟N个机器,同时发送M个请求。

基本格式:redis-benchmark -h [IP地址] -p [端口号] -c [并发数] -n [请求数]
在这里插入图片描述

注意:我们在使用redis-benchmark时,要保证redis-server是启动的。

第一步:启动redis-server
命令1:cd /usr/local/bin
命令2:redis-server myconfig/redis.conf

第二步:模拟了100个并发连接数,请求数为10w进行测试
命令3:redis-benchmark -h localhost -p 6379 -c 10 -n 10000

结果分析(节选片段):

====== SET ======
  10000 requests completed in 0.20 seconds               # 0.2秒内完成了1万条的请求
  10 parallel clients									 # 10台并行客户端
  3 bytes payload										 # 每次测试3个字节
  keep alive: 1											 # 一台redis服务器
  host configuration "save": 3600 1 300 100 60 10000
  host configuration "appendonly": no
  multi-thread: no
  
Latency by percentile distribution:						 # 按百分比分布的延迟
0.000% <= 0.039 milliseconds (cumulative count 1)
50.000% <= 0.103 milliseconds (cumulative count 5181)
75.000% <= 0.135 milliseconds (cumulative count 7579)
87.500% <= 0.199 milliseconds (cumulative count 8791)
93.750% <= 0.263 milliseconds (cumulative count 9385)
96.875% <= 0.335 milliseconds (cumulative count 9688)
98.438% <= 0.479 milliseconds (cumulative count 9847)
99.219% <= 0.663 milliseconds (cumulative count 9922)
99.609% <= 0.815 milliseconds (cumulative count 9961)
99.805% <= 0.975 milliseconds (cumulative count 9984)
99.902% <= 1.319 milliseconds (cumulative count 9992)
99.951% <= 2.047 milliseconds (cumulative count 9996)
99.976% <= 2.087 milliseconds (cumulative count 9998)
99.988% <= 2.095 milliseconds (cumulative count 9999)
99.994% <= 2.111 milliseconds (cumulative count 10000)
100.000% <= 2.111 milliseconds (cumulative count 10000)

Cumulative distribution of latencies:					 # 延迟的累计分布
51.810% <= 0.103 milliseconds (cumulative count 5181)
88.870% <= 0.207 milliseconds (cumulative count 8887)
96.080% <= 0.303 milliseconds (cumulative count 9608)
97.900% <= 0.407 milliseconds (cumulative count 9790)
98.540% <= 0.503 milliseconds (cumulative count 9854)
99.060% <= 0.607 milliseconds (cumulative count 9906)
99.330% <= 0.703 milliseconds (cumulative count 9933)
99.600% <= 0.807 milliseconds (cumulative count 9960)
99.720% <= 0.903 milliseconds (cumulative count 9972)
99.880% <= 1.007 milliseconds (cumulative count 9988)
99.900% <= 1.103 milliseconds (cumulative count 9990)
99.920% <= 1.407 milliseconds (cumulative count 9992)
99.940% <= 2.007 milliseconds (cumulative count 9994)
99.990% <= 2.103 milliseconds (cumulative count 9999)
100.000% <= 3.103 milliseconds (cumulative count 10000)

Summary:		# 汇总信息
  throughput summary: 47846.89 requests per second      # 每秒处理47846.89次请求
  latency summary (msec):    # 延迟汇总 ,延迟 (latency) 是指从客户端发送命令到客户端接收到命令返回值的时间间隔
          avg       min       p50       p95       p99       max
        0.133     0.032     0.103     0.287     0.591     2.111



✈ ❀ 希望平凡の我,可以给你不凡の体验 ☂ ✿ ,白嫖有罪 ☠ ,记得关注哦 ❥(^_-) …
在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值