redis-benchmark测试
机器:1核心 2g Centos7.3
测试:100个并发,100000个请求
命令:
redis-benchmark [option] [option value]
redis-benchmark -h [localhost] -p [port] -c [paramllism] -n [requests]
redis 性能测试工具可选参数如下所示:
序号 | 选项 | 描述 | 默认值 |
---|---|---|---|
1 | -h | 指定服务器主机名 | 127.0.0.1 |
2 | -p | 指定服务器端口 | 6379 |
3 | -s | 指定服务器 socket | |
4 | -c | 指定并发连接数 | 50 |
5 | -n | 指定请求数 | 10000 |
6 | -d | 以字节的形式指定 SET/GET 值的数据大小 | 2 |
7 | -k | 1=keep alive 0=reconnect | 1 |
8 | -r | SET/GET/INCR 使用随机 key, SADD 使用随机值 | |
9 | -P | 通过管道传输 <numreq> 请求 | 1 |
10 | -q | 强制退出 redis。仅显示 query/sec 值 | |
11 | --csv | 以 CSV 格式输出 | |
12 | -l | 生成循环,永久执行测试 | |
13 | -t | 仅运行以逗号分隔的测试命令列表。 | |
14 | -I | Idle 模式。仅打开 N 个 idle 连接并等待。 |
redis-benchmark -h localhost -p 6379 -c 100 -n 100000
结果
[root@jyong-node bin]# redis-benchmark -h localhost -p 6379 -c 100 -n 100000
====== PING_INLINE ======
100000 requests completed in 0.89 seconds
100 parallel clients ####100并发
3 bytes payload ####每次写入3个字节
keep alive: 1
99.59% <= 1 milliseconds #处理99.59%耗时1毫秒
99.90% <= 4 milliseconds #处理99.90%耗时4毫秒
100.00% <= 4 milliseconds #处理100.00%耗时4毫秒
112866.82 requests per second
====== PING_BULK ======测试批量写入
100000 requests completed in 0.92 seconds
100 parallel clients
3 bytes payload
keep alive: 1
94.74% <= 1 milliseconds
99.80% <= 2 milliseconds
99.99% <= 3 milliseconds
100.00% <= 3 milliseconds
109170.30 requests per second
====== SET ====== 测试set请求
100000 requests completed in 0.94 seconds
100 parallel clients
3 bytes payload
keep alive: 1
96.02% <= 1 milliseconds
99.79% <= 2 milliseconds
99.90% <= 3 milliseconds
99.92% <= 4 milliseconds
100.00% <= 4 milliseconds
106837.61 requests per second
====== GET ====== 测试get请求
100000 requests completed in 0.92 seconds
100 parallel clients
3 bytes payload
keep alive: 1
95.49% <= 1 milliseconds
99.78% <= 2 milliseconds
99.94% <= 3 milliseconds
100.00% <= 3 milliseconds
109051.26 requests per second
====== INCR ====== 测试incr自增请求
100000 requests completed in 0.94 seconds
100 parallel clients
3 bytes payload
keep alive: 1
95.07% <= 1 milliseconds
99.50% <= 2 milliseconds
99.80% <= 3 milliseconds
99.88% <= 4 milliseconds
99.90% <= 13 milliseconds
100.00% <= 13 milliseconds
105932.20 requests per second
====== LPUSH ====== 测试lpush命令请求
100000 requests completed in 0.83 seconds
100 parallel clients
3 bytes payload
keep alive: 1
99.34% <= 1 milliseconds
100.00% <= 1 milliseconds
119760.48 requests per second
====== RPUSH ====== 测试rpush请求
100000 requests completed in 0.83 seconds
100 parallel clients
3 bytes payload
keep alive: 1
99.57% <= 1 milliseconds
99.89% <= 2 milliseconds
100.00% <= 2 milliseconds
121065.38 requests per second
====== LPOP ====== 测试lpop弹出元素命令
100000 requests completed in 0.95 seconds
100 parallel clients
3 bytes payload
keep alive: 1
95.70% <= 1 milliseconds
99.50% <= 2 milliseconds
99.76% <= 3 milliseconds
99.80% <= 4 milliseconds
99.80% <= 8 milliseconds
99.83% <= 9 milliseconds
99.90% <= 16 milliseconds
99.93% <= 17 milliseconds
100.00% <= 17 milliseconds
105596.62 requests per second
====== RPOP ======
100000 requests completed in 0.82 seconds
100 parallel clients
3 bytes payload
keep alive: 1
98.83% <= 1 milliseconds
99.21% <= 2 milliseconds
100.00% <= 2 milliseconds
121212.12 requests per second
====== SADD ======
100000 requests completed in 0.86 seconds
100 parallel clients
3 bytes payload
keep alive: 1
97.58% <= 1 milliseconds
99.81% <= 2 milliseconds
100.00% <= 2 milliseconds
116686.12 requests per second
====== HSET ======
100000 requests completed in 0.93 seconds
100 parallel clients
3 bytes payload
keep alive: 1
93.64% <= 1 milliseconds
99.96% <= 2 milliseconds
100.00% <= 2 milliseconds
107181.13 requests per second
====== SPOP ======
100000 requests completed in 0.90 seconds
100 parallel clients
3 bytes payload
keep alive: 1
95.13% <= 1 milliseconds
99.80% <= 3 milliseconds
99.90% <= 4 milliseconds
100.00% <= 4 milliseconds
111482.72 requests per second
====== LPUSH (needed to benchmark LRANGE) ======
100000 requests completed in 0.94 seconds
100 parallel clients
3 bytes payload
keep alive: 1
90.85% <= 1 milliseconds
99.99% <= 2 milliseconds
100.00% <= 2 milliseconds
106723.59 requests per second
====== LRANGE_100 (first 100 elements) ======
100000 requests completed in 3.68 seconds
100 parallel clients
3 bytes payload
keep alive: 1
0.19% <= 1 milliseconds
26.30% <= 2 milliseconds
65.23% <= 3 milliseconds
94.79% <= 4 milliseconds
99.47% <= 5 milliseconds
99.76% <= 6 milliseconds
99.89% <= 7 milliseconds
99.90% <= 16 milliseconds
99.92% <= 17 milliseconds
99.96% <= 18 milliseconds
100.00% <= 18 milliseconds
27181.30 requests per second
====== LRANGE_300 (first 300 elements) ======
100000 requests completed in 6.96 seconds
100 parallel clients
3 bytes payload
keep alive: 1
0.00% <= 2 milliseconds
10.55% <= 3 milliseconds
33.41% <= 4 milliseconds
57.14% <= 5 milliseconds
80.69% <= 6 milliseconds
95.55% <= 7 milliseconds
98.23% <= 8 milliseconds
99.02% <= 9 milliseconds
99.40% <= 10 milliseconds
99.66% <= 11 milliseconds
99.79% <= 12 milliseconds
99.80% <= 16 milliseconds
99.81% <= 17 milliseconds
99.83% <= 18 milliseconds
99.85% <= 19 milliseconds
99.88% <= 20 milliseconds
99.90% <= 21 milliseconds
99.92% <= 22 milliseconds
99.94% <= 23 milliseconds
99.96% <= 24 milliseconds
99.98% <= 25 milliseconds
100.00% <= 25 milliseconds
14363.69 requests per second
====== LRANGE_500 (first 450 elements) ======
100000 requests completed in 10.92 seconds
100 parallel clients
3 bytes payload
keep alive: 1
0.00% <= 1 milliseconds
0.02% <= 2 milliseconds
0.06% <= 3 milliseconds
3.82% <= 4 milliseconds
16.66% <= 5 milliseconds
31.05% <= 6 milliseconds
45.75% <= 7 milliseconds
60.95% <= 8 milliseconds
76.07% <= 9 milliseconds
87.97% <= 10 milliseconds
92.90% <= 11 milliseconds
94.93% <= 12 milliseconds
96.28% <= 13 milliseconds
97.25% <= 14 milliseconds
98.08% <= 15 milliseconds
98.77% <= 16 milliseconds
99.41% <= 17 milliseconds
99.74% <= 18 milliseconds
99.83% <= 19 milliseconds
99.89% <= 20 milliseconds
99.94% <= 21 milliseconds
99.96% <= 22 milliseconds
99.96% <= 34 milliseconds
99.97% <= 35 milliseconds
99.99% <= 36 milliseconds
100.00% <= 36 milliseconds
9155.83 requests per second
====== LRANGE_600 (first 600 elements) ======
100000 requests completed in 13.85 seconds
100 parallel clients
3 bytes payload
keep alive: 1
0.00% <= 1 milliseconds
0.01% <= 2 milliseconds
0.02% <= 3 milliseconds
0.05% <= 4 milliseconds
1.61% <= 5 milliseconds
10.79% <= 6 milliseconds
22.17% <= 7 milliseconds
33.95% <= 8 milliseconds
45.83% <= 9 milliseconds
57.74% <= 10 milliseconds
69.59% <= 11 milliseconds
81.27% <= 12 milliseconds
90.84% <= 13 milliseconds
95.37% <= 14 milliseconds
96.97% <= 15 milliseconds
97.72% <= 16 milliseconds
98.20% <= 17 milliseconds
98.57% <= 18 milliseconds
98.88% <= 19 milliseconds
99.14% <= 20 milliseconds
99.38% <= 21 milliseconds
99.56% <= 22 milliseconds
99.67% <= 23 milliseconds
99.71% <= 24 milliseconds
99.75% <= 25 milliseconds
99.79% <= 26 milliseconds
99.82% <= 27 milliseconds
99.86% <= 28 milliseconds
99.90% <= 29 milliseconds
99.93% <= 30 milliseconds
99.96% <= 31 milliseconds
99.98% <= 32 milliseconds
99.99% <= 33 milliseconds
100.00% <= 33 milliseconds
7221.26 requests per second
====== MSET (10 keys) ======
100000 requests completed in 1.08 seconds
100 parallel clients
3 bytes payload
keep alive: 1
85.81% <= 1 milliseconds
99.83% <= 2 milliseconds
100.00% <= 2 milliseconds
92336.11 requests per second