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. Spring4学习笔记 - SpEL表达式

  2. 25款专业的 WordPress 电子商务网站主题

    WordPress 作为最流行的博客系统,插件众多,易于扩充功能.安装和使用都非常方便,而且有许多第三方开发的免费模板,安装方式简单易用.这篇文章和大家分享35款专业的 WordPress 电子商务网 ...

  3. 从客户端(?)中检测到有潜在危险的 Request.Path 值 的解决方案

    public ActionResult A(string title) { return Redirect("B"+((String.IsNullOrEmpty(title))?& ...

  4. Nodejs学习笔记(四)--- 与MySQL交互(felixge/node-mysql)

    目录 简介和安装 测试MySQL 认识一下Connection Options MYSQL CURD 插入 更新 查询 删除 Nodejs 调用带out参数的存储过程,并得到out参数返回值 结束数据 ...

  5. Windows 上的 Jetty 小工具

    做项目经常遇到需要开发Java应用,我喜欢用Jetty进行开发.部署,主要是由于Jetty的轻量级. Jetty 项目主页:http://www.eclipse.org/jetty/, 最新版9.30 ...

  6. Android悬浮窗实现 使用WindowManager

    Android悬浮窗实现 使用WindowManager WindowManager介绍 通过Context.getSystemService(Context.WINDOW_SERVICE)可以获得  ...

  7. UWP开发中两种网络图片缓存方法

    通常情况下,我们的程序需要从服务器读取图片,但如果需要不止一次读取某一张图片的话,就需要做本地缓存了,这样既为用户省一点流量,又能显得你的APP很快. 假如你已经知道了某一张图片的地址,那么第一件事就 ...

  8. Android Adapter的几个方法

    1  ListView是在什么时候设置对Adapter的数据监听的? 在setAdapter(ListAdapter adapter)中,会先取消ListView中原来的mAdapter中的数据监听( ...

  9. iOS-公司开发者账号的申请和注册(博主原创+亲身经历+2016年申请+附带与邓白氏公司的往来邮件截图)

    不吹不黑,此篇博客真乃我的良心之作啊,希望对大家有所帮助! 链接在简书:http://www.jianshu.com/p/9de6a8eb4d88

  10. Learn how to Use UIPageViewController in iOS

    下面学习内容来自国外的IOS学习网站:The AppGuruz: UIPageViewController in iOS  也许需要FQ哦 认真做一遍上面入门UIPageController的教程,然 ...