Redis-benchmark是官方自带的Redis性能测试工具,可以有效的测试Redis服务的性能。

使用说明如下:

Usage: redis-benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-k <boolean>]

 -h <hostname>      Server hostname (default 127.0.0.1)
-p <port> Server port (default )
-s <socket> Server socket (overrides host and port)
-c <clients> Number of parallel connections (default )
-n <requests> Total number of requests (default )
-d <size> Data size of SET/GET value in bytes (default )
-k <boolean> =keep alive =reconnect (default )
-r <keyspacelen> Use random keys for SET/GET/INCR, random values for SADD
Using this option the benchmark will get/set keys
in the form mykey_rand: instead of constant
keys, the <keyspacelen> argument determines the max
number of values for the random number. For instance
if set to only rand: - rand:
range will be allowed.
-P <numreq> Pipeline <numreq> requests. Default (no pipeline).
-q Quiet. Just show query/sec values
--csv Output in CSV format
-l Loop. Run the tests forever
-t <tests> Only run the comma-separated list of tests. The test
names are the same as the ones produced as output.
-I Idle mode. Just open N idle connections and wait.

测试命令事例:

1、redis-benchmark -h 192.168.1.201 -p 6379 -c 100 -n 100000 
100个并发连接,100000个请求,检测host为localhost 端口为6379的redis服务器性能

2、redis-benchmark -h 192.168.1.201 -p 6379 -q -d 100

测试存取大小为100字节的数据包的性能

3、redis-benchmark -t set,lpush -n 100000 -q

只测试某些操作的性能

4、redis-benchmark -n 100000 -q script load "redis.call('set','foo','bar')"

只测试某些数值存取的性能

测试结果分析:

   requests completed in 0.30 seconds
parallel clients
bytes payload
keep alive: 0.11% <= milliseconds
86.00% <= milliseconds
90.12% <= milliseconds
96.68% <= milliseconds
99.27% <= milliseconds
99.54% <= milliseconds
99.69% <= milliseconds
99.78% <= milliseconds
99.89% <= milliseconds
100.00% <= milliseconds
33222.59 requests per second ====== PING_BULK ======
requests completed in 0.27 seconds
parallel clients
bytes payload
keep alive: 0.93% <= milliseconds
97.66% <= milliseconds
100.00% <= milliseconds
37174.72 requests per second ====== SET ======
requests completed in 0.32 seconds
parallel clients
bytes payload
keep alive: 0.22% <= milliseconds
91.68% <= milliseconds
97.78% <= milliseconds
98.80% <= milliseconds
99.38% <= milliseconds
99.61% <= milliseconds
99.72% <= milliseconds
99.83% <= milliseconds
99.94% <= milliseconds
100.00% <= milliseconds
30959.75 requests per second ====== GET ======
requests completed in 0.28 seconds
parallel clients
bytes payload
keep alive: 0.55% <= milliseconds
98.86% <= milliseconds
100.00% <= milliseconds
35971.22 requests per second ====== INCR ======
requests completed in 0.14 seconds
parallel clients
bytes payload
keep alive: 95.61% <= milliseconds
100.00% <= milliseconds
69444.45 requests per second ====== LPUSH ======
requests completed in 0.21 seconds
parallel clients
bytes payload
keep alive: 18.33% <= milliseconds
100.00% <= milliseconds
48309.18 requests per second ====== LPOP ======
requests completed in 0.23 seconds
parallel clients
bytes payload
keep alive: 0.29% <= milliseconds
99.76% <= milliseconds
100.00% <= milliseconds
44052.86 requests per second ====== SADD ======
requests completed in 0.22 seconds
parallel clients
bytes payload
keep alive: 2.37% <= milliseconds
99.81% <= milliseconds
100.00% <= milliseconds
44444.45 requests per second ====== SPOP ======
requests completed in 0.22 seconds
parallel clients
bytes payload
keep alive: 4.27% <= milliseconds
99.84% <= milliseconds
100.00% <= milliseconds
44642.86 requests per second ====== LPUSH (needed to benchmark LRANGE) ======
requests completed in 0.22 seconds
parallel clients
bytes payload
keep alive: 12.35% <= milliseconds
99.62% <= milliseconds
100.00% <= milliseconds
46082.95 requests per second ====== LRANGE_100 (first elements) ======
requests completed in 0.48 seconds
parallel clients
bytes payload
keep alive: 0.01% <= milliseconds
3.27% <= milliseconds
98.71% <= milliseconds
99.93% <= milliseconds
100.00% <= milliseconds
20964.36 requests per second ====== LRANGE_300 (first elements) ======
requests completed in 1.26 seconds
parallel clients
bytes payload
keep alive: 0.01% <= milliseconds
0.14% <= milliseconds
0.90% <= milliseconds
7.03% <= milliseconds
31.68% <= milliseconds
78.93% <= milliseconds
98.88% <= milliseconds
99.56% <= milliseconds
99.72% <= milliseconds
99.95% <= milliseconds
100.00% <= milliseconds
7961.78 requests per second ====== LRANGE_500 (first elements) ======
requests completed in 1.82 seconds
parallel clients
bytes payload
keep alive: 0.01% <= milliseconds
0.06% <= milliseconds
0.14% <= milliseconds
0.30% <= milliseconds
0.99% <= milliseconds
2.91% <= milliseconds
8.11% <= milliseconds
43.15% <= milliseconds
88.38% <= milliseconds
97.25% <= milliseconds
98.61% <= milliseconds
99.26% <= milliseconds
99.30% <= milliseconds
99.44% <= milliseconds
99.48% <= milliseconds
99.64% <= milliseconds
99.85% <= milliseconds
99.92% <= milliseconds
99.95% <= milliseconds
99.96% <= milliseconds
99.97% <= milliseconds
100.00% <= milliseconds
5491.49 requests per second ====== LRANGE_600 (first elements) ======
requests completed in 2.29 seconds
parallel clients
bytes payload
keep alive: 0.01% <= milliseconds
0.05% <= milliseconds
0.10% <= milliseconds
0.19% <= milliseconds
0.34% <= milliseconds
0.46% <= milliseconds
0.58% <= milliseconds
4.46% <= milliseconds
21.80% <= milliseconds
40.48% <= milliseconds
60.14% <= milliseconds
79.81% <= milliseconds
93.77% <= milliseconds
97.14% <= milliseconds
98.67% <= milliseconds
99.08% <= milliseconds
99.30% <= milliseconds
99.41% <= milliseconds
99.52% <= milliseconds
99.61% <= milliseconds
99.79% <= milliseconds
99.88% <= milliseconds
99.89% <= milliseconds
99.95% <= milliseconds
99.96% <= milliseconds
99.97% <= milliseconds
99.98% <= milliseconds
100.00% <= milliseconds
4359.20 requests per second ====== MSET ( keys) ======
requests completed in 0.37 seconds
parallel clients
bytes payload
keep alive: 0.01% <= milliseconds
2.00% <= milliseconds
18.41% <= milliseconds
88.55% <= milliseconds
96.09% <= milliseconds
99.50% <= milliseconds
99.65% <= milliseconds
99.75% <= milliseconds
99.77% <= milliseconds
99.78% <= milliseconds
99.79% <= milliseconds
99.80% <= milliseconds
99.81% <= milliseconds
99.82% <= milliseconds
99.83% <= milliseconds
99.84% <= milliseconds
99.85% <= milliseconds
99.86% <= milliseconds
99.87% <= milliseconds
99.88% <= milliseconds
99.89% <= milliseconds
99.90% <= milliseconds
99.91% <= milliseconds
99.92% <= milliseconds
99.93% <= milliseconds
99.95% <= milliseconds
99.96% <= milliseconds
99.97% <= milliseconds
99.98% <= milliseconds
99.99% <= milliseconds
100.00% <= milliseconds
27173.91 requests per second

Redis-benchmark测试Redis性能的更多相关文章

  1. YCSB benchmark测试mongodb性能——和web服务器测试性能结果类似

    转自:http://blog.sina.com.cn/s/blog_48c95a190102v9kg.html         YCSB(Yahoo! Cloud Serving Benchmark) ...

  2. YCSB benchmark测试cassandra性能——和web服务器测试性能结果类似

    转自:http://www.itdadao.com/articles/c15a531189p0.html http://www.cnblogs.com/bettersky/p/6158172.html ...

  3. 【Redis】Redis-benchmark测试Redis性能

    Redis-benchmark是官方自带的Redis性能测试工具,可以有效的测试Redis服务的性能. 使用说明如下: Usage: redis-benchmark [-h <host>] ...

  4. Redis(十九):Redis压力测试工具benchmark

    redis-benchmark使用参数介绍 Redis 自带了一个叫 redis-benchmark 的工具来模拟 N 个客户端同时发出 M 个请求. (类似于 Apache ab 程序).你可以使用 ...

  5. 【Azure Redis 缓存 Azure Cache For Redis】使用Redis自带redis-benchmark.exe命令测试Azure Redis的性能

    问题描述 关于Azure Redis的性能问题,在官方文档中,可以查看到不同层级Redis的最大连接数,每秒处理请求的性能. 基本缓存和标准缓存 C0 (250 MB) 缓存 - 最多支持 256 个 ...

  6. Azure Redis Cache (3) 在Windows 环境下使用Redis Benchmark

    <Windows Azure Platform 系列文章目录> 熟悉Redis环境的读者都知道,我们可以在Linux环境里,使用Redis Benchmark,测试Redis的性能. ht ...

  7. 搭建和测试 Redis 主备和集群

    本文章只是自我学习用,不适宜转载. 1. Redis主备集群 1.1 搭建步骤 机器:海航云虚机(2核4GB内存),使用 Centos 7.2 64bit 操作系统,IP 分别是 192.168.10 ...

  8. Redis QPS测试

    1.计算qps: 1)redis发布版本中自带了redis-benchmark性能测试工具,可以使用它计算qps.示例:使用50个并发连接,发出100000个请求,每个请求的数据为2kb,测试host ...

  9. 『性能』ServiceStack.Redis 和 StackExchange.Redis 性能比较

    背景 近来,需要用到 Redis 这类缓存技术 —— MongoDB 和 Redis 没有进行过比较. 我也懒得在这些细节上 纠结那么多 —— 按照网友给出的文章,听从网友建议,选择 Redis. R ...

随机推荐

  1. 什么时候加上android.intent.category.DEFAULT

    什么时候加上android.intent.category.DEFAULT 1.要弄清楚这个问题,首先需要弄明白什么是implicit(隐藏) intent什么是explicit(明确) intent ...

  2. Linux IO函数的使用和区别

    Linux系统中的IO函数主要有read.write.recv.send.recvmsg.sendmsg.readv.writev,本篇主要介绍他们的使用以及区别. read函数: #include ...

  3. [js开源组件开发]network异步请求ajax的扩展

    network异步请求ajax的扩展 在日常的应用中,你可能直接调用$.ajax是会有些问题的,比如说用户的重复点击,比如说我只希望它成功提交一次后就不能再提交,比如说我希望有个正在提交的loadin ...

  4. 【javascript激增的思考04】MVC与Backbone.js(beta)

    前言 最近整理了很多前端面试题的东西,今天又去参加了一次面试,不知各位烦不烦,我反正有点累了,于是我们今天继续回到我们前段时间研究的问题,我们再来看看MVC吧. 什么是MVC 又回到这个问题了,到底什 ...

  5. jQuery原型方法first,last,eq,slice源码分析

    这4个方法中前3个方法很常用大家都见过,但是slice方法可能会以为是数组方法,其实slice也是jQuery的一个原型方法,只不过是底层方法是为其他方法服务的(更具体点是为eq方法服务的),首先还是 ...

  6. iOS上new Date出现Invalid Date的问题,

    用angular的ngModel绑定time的时候,在安卓调试没问题,没想到在iOS上出现了NaN:NaN,后台丢过来的数据大概是这样的2016-03-08 20:14 然而问题就出在这个分隔符&qu ...

  7. DropDownList

    DropDownList 1,DataValueField获取或设置为各列表项提供值的数据源字段 绑定的是唯一的标识 比如是id列 使用SelectedValue获取绑定的数据使用的前端看不到的数据类 ...

  8. atitit.身份认证解决方案attilax总结

    atitit.身份认证解决方案attilax总结 1.1. 身份认证1 1.2.  basic认证1 1.2.1. 编程实现basic客户端2 1.3. digest认证机制3 1.4. SSL认证3 ...

  9. N900快捷键

    Ctrl + C 复制文本 Ctrl + V 粘贴文本 Ctrl + X 剪切文本 Ctrl + A 全部选择 Ctrl + O 打开 Ctrl + N 新建 Ctrl + S 保存 Ctrl + Z ...

  10. DevExpress VCL 13.1.4支持Delphi /C++Builder XE5

    DevExpress VCL 13.1.4支持Delphi /C++Builder XE5 重大变化 ExpressLibrary dxHalfOfPi常数声明已经从cxGeometry单元移到了cx ...