【Redis】Redis-benchmark测试Redis性能
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 6379)
-s <socket> Server socket (overrides host and port)
-c <clients> Number of parallel connections (default 50)
-n <requests> Total number of requests (default 10000)
-d <size> Data size of SET/GET value in bytes (default 2)
-k <boolean> 1=keep alive 0=reconnect (default 1)
-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:000000012456 instead of constant
keys, the <keyspacelen> argument determines the max
number of values for the random number. For instance
if set to 10 only rand:000000000000 - rand:000000000009
range will be allowed.
-P <numreq> Pipeline <numreq> requests. Default 1 (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 127.0.0.1 -p 6379 -c 100 -n 100000
100个并发连接,100000个请求,检测host为localhost 端口为6379的redis服务器性能
2、redis-benchmark -h 127.0.0.1 -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')"
只测试某些数值存取的性能
测试结果分析
1 [root@H__D redis]# redis-benchmark -h 127.0.0.1 -p 6379 -c 100 -n 100000
2 ====== PING_INLINE ======
3 100000 requests completed in 0.94 seconds
4 100 parallel clients
5 3 bytes payload
6 keep alive: 1
7
8 99.50% <= 1 milliseconds
9 99.97% <= 2 milliseconds
10 100.00% <= 2 milliseconds
11 106951.88 requests per second
12
13 ====== PING_BULK ======
14 100000 requests completed in 0.89 seconds
15 100 parallel clients
16 3 bytes payload
17 keep alive: 1
18
19 99.43% <= 1 milliseconds
20 99.98% <= 2 milliseconds
21 100.00% <= 2 milliseconds
22 111856.82 requests per second
23
24 ====== SET ======
25 100000 requests completed in 0.92 seconds
26 100 parallel clients
27 3 bytes payload
28 keep alive: 1
29
30 99.67% <= 1 milliseconds
31 100.00% <= 2 milliseconds
32 108459.87 requests per second
33
34 ====== GET ======
35 100000 requests completed in 0.91 seconds
36 100 parallel clients
37 3 bytes payload
38 keep alive: 1
39
40 99.60% <= 1 milliseconds
41 100.00% <= 2 milliseconds
42 100.00% <= 2 milliseconds
43 109769.48 requests per second
44
45 ====== INCR ======
46 100000 requests completed in 0.92 seconds
47 100 parallel clients
48 3 bytes payload
49 keep alive: 1
50
51 99.64% <= 1 milliseconds
52 100.00% <= 2 milliseconds
53 100.00% <= 2 milliseconds
54 109289.62 requests per second
55
56 ====== LPUSH ======
57 100000 requests completed in 0.92 seconds
58 100 parallel clients
59 3 bytes payload
60 keep alive: 1
61
62 99.71% <= 1 milliseconds
63 100.00% <= 2 milliseconds
64 100.00% <= 2 milliseconds
65 109170.30 requests per second
66
67 ====== RPUSH ======
68 100000 requests completed in 0.92 seconds
69 100 parallel clients
70 3 bytes payload
71 keep alive: 1
72
73 99.64% <= 1 milliseconds
74 99.99% <= 2 milliseconds
75 100.00% <= 2 milliseconds
76 108695.65 requests per second
77
78 ====== LPOP ======
79 100000 requests completed in 0.91 seconds
80 100 parallel clients
81 3 bytes payload
82 keep alive: 1
83
84 99.62% <= 1 milliseconds
85 99.99% <= 2 milliseconds
86 100.00% <= 2 milliseconds
87 109529.02 requests per second
88
89 ====== RPOP ======
90 100000 requests completed in 0.91 seconds
91 100 parallel clients
92 3 bytes payload
93 keep alive: 1
94
95 99.74% <= 1 milliseconds
96 99.99% <= 2 milliseconds
97 100.00% <= 2 milliseconds
98 109409.20 requests per second
99
100 ====== SADD ======
101 100000 requests completed in 0.92 seconds
102 100 parallel clients
103 3 bytes payload
104 keep alive: 1
105
106 99.61% <= 1 milliseconds
107 99.99% <= 2 milliseconds
108 100.00% <= 2 milliseconds
109 109051.26 requests per second
110
111 ====== HSET ======
112 100000 requests completed in 0.93 seconds
113 100 parallel clients
114 3 bytes payload
115 keep alive: 1
116
117 99.32% <= 1 milliseconds
118 99.98% <= 2 milliseconds
119 100.00% <= 2 milliseconds
120 107642.62 requests per second
121
122 ====== SPOP ======
123 100000 requests completed in 0.90 seconds
124 100 parallel clients
125 3 bytes payload
126 keep alive: 1
127
128 99.76% <= 1 milliseconds
129 100.00% <= 1 milliseconds
130 110741.97 requests per second
131
132 ====== LPUSH (needed to benchmark LRANGE) ======
133 100000 requests completed in 0.92 seconds
134 100 parallel clients
135 3 bytes payload
136 keep alive: 1
137
138 99.69% <= 1 milliseconds
139 99.99% <= 2 milliseconds
140 100.00% <= 2 milliseconds
141 108577.63 requests per second
142
143 ====== LRANGE_100 (first 100 elements) ======
144 100000 requests completed in 0.93 seconds
145 100 parallel clients
146 3 bytes payload
147 keep alive: 1
148
149 99.77% <= 1 milliseconds
150 100.00% <= 1 milliseconds
151 108108.11 requests per second
152
153 ====== LRANGE_300 (first 300 elements) ======
154 100000 requests completed in 0.93 seconds
155 100 parallel clients
156 3 bytes payload
157 keep alive: 1
158
159 99.52% <= 1 milliseconds
160 100.00% <= 2 milliseconds
161 100.00% <= 2 milliseconds
162 107296.14 requests per second
163
164 ====== LRANGE_500 (first 450 elements) ======
165 100000 requests completed in 0.94 seconds
166 100 parallel clients
167 3 bytes payload
168 keep alive: 1
169
170 99.64% <= 1 milliseconds
171 99.99% <= 2 milliseconds
172 100.00% <= 2 milliseconds
173 106723.59 requests per second
174
175 ====== LRANGE_600 (first 600 elements) ======
176 100000 requests completed in 0.92 seconds
177 100 parallel clients
178 3 bytes payload
179 keep alive: 1
180
181 99.73% <= 1 milliseconds
182 100.00% <= 2 milliseconds
183 108225.10 requests per second
184
185 ====== MSET (10 keys) ======
186 100000 requests completed in 1.06 seconds
187 100 parallel clients
188 3 bytes payload
189 keep alive: 1
190
191 91.36% <= 1 milliseconds
192 99.97% <= 2 milliseconds
193 100.00% <= 2 milliseconds
194 94517.96 requests per second
[root@H__D redis]# redis-benchmark -h 127.0.0.1 -p 6379 -q -d 100
PING_INLINE: 113122.17 requests per second
PING_BULK: 117785.63 requests per second
SET: 114285.71 requests per second
GET: 116144.02 requests per second
INCR: 116144.02 requests per second
LPUSH: 113895.21 requests per second
RPUSH: 113507.38 requests per second
LPOP: 116550.12 requests per second
RPOP: 116279.07 requests per second
SADD: 115740.73 requests per second
HSET: 112866.82 requests per second
SPOP: 116279.07 requests per second
LPUSH (needed to benchmark LRANGE): 113636.37 requests per second
LRANGE_100 (first 100 elements): 114025.09 requests per second
LRANGE_300 (first 300 elements): 113895.21 requests per second
LRANGE_500 (first 450 elements): 113507.38 requests per second
LRANGE_600 (first 600 elements): 114155.25 requests per second
MSET (10 keys): 93023.25 requests per second
【Redis】Redis-benchmark测试Redis性能的更多相关文章
- YCSB benchmark测试mongodb性能——和web服务器测试性能结果类似
转自:http://blog.sina.com.cn/s/blog_48c95a190102v9kg.html YCSB(Yahoo! Cloud Serving Benchmark) ...
- YCSB benchmark测试cassandra性能——和web服务器测试性能结果类似
转自:http://www.itdadao.com/articles/c15a531189p0.html http://www.cnblogs.com/bettersky/p/6158172.html ...
- Redis-benchmark测试Redis性能
Redis-benchmark是官方自带的Redis性能测试工具,可以有效的测试Redis服务的性能. 使用说明如下: Usage: redis-benchmark [-h <host>] ...
- Redis(十九):Redis压力测试工具benchmark
redis-benchmark使用参数介绍 Redis 自带了一个叫 redis-benchmark 的工具来模拟 N 个客户端同时发出 M 个请求. (类似于 Apache ab 程序).你可以使用 ...
- 搭建和测试 Redis 主备和集群
本文章只是自我学习用,不适宜转载. 1. Redis主备集群 1.1 搭建步骤 机器:海航云虚机(2核4GB内存),使用 Centos 7.2 64bit 操作系统,IP 分别是 192.168.10 ...
- Redis配置文件各项参数说明及性能调优
Redis配置文件参数说明: 1. Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程 daemonize no 2. 当Redis以守护进程方式运行时,Redis默 ...
- 【Redis】Redis基础 - Redis安装启动测试
Redis基本 - 安装 文章目录 Redis基本 - 安装 Linux下安装Redis Docker 方式 Github 源码编译方式 直接安装方式 Windows下Redis安装 记录 - Red ...
- Jedis测试redis
首先:Jedis是redis的java版本的客户端. public class JedisTest { //单机版测试Jedis,不使用连接池 @Test public void testJedis( ...
- 测试redis+keepalived实现简单的主备切换【转载】
转自: 测试redis+keepalived实现简单的主备切换 - Try My Best 尽力而为 - ITeye技术网站http://raising.iteye.com/blog/2311757 ...
随机推荐
- Linux之间配置SSH互信(SSH免密码登录)
为简化SSH过程,采用证书方式,免去SSH登入时需要输入账号密码的过程,具体操作如下: 一.在SSH服务器所在机器上 1.以root用户登录,更改ssh配置文件 /etc/ssh/sshd_confi ...
- 对于装office 365时,visio不兼容的解决
先将office 365装好,之后从这个网址下载visio安装即可,但是没有 激活码,需要自己激活: 网址:链接: https://pan.baidu.com/s/1OqONPuJ0eumrpts-X ...
- Win10 安装 Anaconda3 用 Anaconda3 安装TensorFlow 1.2 (只支持python3.5)
Win10 安装 Anaconda3 1.安装Anaconda3 选择相应的Anaconda进行安装,下载地址点击这里,下载对应系统版本的Anaconda,官网现在的版本是Anaconda 4.3.1 ...
- echarts中国地图散点涟漪效果
echarts中国地图例子:http://gallery.echartsjs.com/editor.html?c=effectScatter-map 代码: var data = [{ name: ' ...
- 定时器修改button标题闪烁
在做一个项目时,用到UIButton来设置接收短信验证码的倒计时,但是用NSTimer来设置标题会出现连续闪烁的问题. 经过测试发现了一下内容,如果只是单独的设置button的titleLabel的内 ...
- AngularJS——第2章 模块化
第2章 模块化 使用AngularJS构建应用时是以模块化的方式组织的,即将整个应用划分成多个小模块,各个模块有各自的职责,最终实现完整的应用. 2.1 定义应用 通过为任一HTML标签添加ng-ap ...
- linux命令学习之:rm
rm命令可以删除一个目录中的一个或多个文件或目录,也可以将某个目录及其下属的所有文件及其子目录均删除掉.对于链接文件,只是删除整个链接文件,而原有文件保持不变. 注意:使用rm命令要格外小心.因为一旦 ...
- how2j网站前端项目——天猫前端(第一次)学习笔记6
开始我的订单页面 学着学着,会觉得我这是在干啥呢?我要学的是Java不是吗?怎么要学这么久的前端啊?说实话,我很迷茫,不知道以后的工作具体是做什么?学的这些能用到吗? 不过,还是要把这个项目跟着走完! ...
- 【RabbitMQ】——5种队列(转)
原文地址:https://blog.csdn.net/u012654963/article/details/76417613 应用RabbitMQ,我们可以根据需求选择5种队列之一. 一.简单队列 P ...
- eclipse中运行tomcat提示端口被占的4种解决方案
错误信息:Several ports (8005, 8080, 8009) required by Tomcat v5.5 Server at localhost are already in use ...