使用Redis-benchmark为Redis性能测试
2014-09-04 18:23
826 查看
Redis-benchmark为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.
实例:
redis-benchmark -h 127.0.0.1 -p 6379 -q -d 100
SET/GET 100 bytes 检测host为127.0.0.1 端口为6379的redis服务器性能
redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000
5000个并发连接,100000个请求,检测host为127.0.0.1 端口为6379的redis服务器性能
benchmark工具测试信息:
测试命令:
redis-benchmark -n 100000 -c 60
向redis服务器发送100000个请求,每个请求附带60个并发客户端
结果(部分):
====== SET ======
对集合写入测试
100000 requests completed in 2.38 seconds
100000个请求在2.38秒内完成
60 parallel clients
每次请求有60个并发客户端
3 bytes payload
每次写入3个字节的数据
keep alive: 1
保持一个连接,一台服务器来处理这些请求
93.06% <= 15 milliseconds
99.96% <= 31 milliseconds
99.98% <= 46 milliseconds
99.99% <= 62 milliseconds
100.00% <= 62 milliseconds
所有请求在62毫秒内完成
42105.26 requests per second
每秒处理42105.26次请求
[root@localhost ~]# redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000 -d 100 -q
PING_INLINE: 34506.55 requests per second
PING_BULK: 34059.95 requests per second
SET: 31959.09 requests per second
GET: 31466.33 requests per second
INCR: 33311.12 requests per second
LPUSH: 29265.44 requests per second
LPOP: 36968.58 requests per second
SADD: 32030.75 requests per second
SPOP: 33344.45 requests per second
LPUSH (needed to benchmark LRANGE): 29735.36 requests per second
LRANGE_100 (first 100 elements): 16116.04 requests per second
LRANGE_300 (first 300 elements): 6659.56 requests per second
LRANGE_500 (first 450 elements): 4108.29 requests per second
指令说明:
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.
实例:
redis-benchmark -h 127.0.0.1 -p 6379 -q -d 100
SET/GET 100 bytes 检测host为127.0.0.1 端口为6379的redis服务器性能
redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000
5000个并发连接,100000个请求,检测host为127.0.0.1 端口为6379的redis服务器性能
benchmark工具测试信息:
测试命令:
redis-benchmark -n 100000 -c 60
向redis服务器发送100000个请求,每个请求附带60个并发客户端
结果(部分):
====== SET ======
对集合写入测试
100000 requests completed in 2.38 seconds
100000个请求在2.38秒内完成
60 parallel clients
每次请求有60个并发客户端
3 bytes payload
每次写入3个字节的数据
keep alive: 1
保持一个连接,一台服务器来处理这些请求
93.06% <= 15 milliseconds
99.96% <= 31 milliseconds
99.98% <= 46 milliseconds
99.99% <= 62 milliseconds
100.00% <= 62 milliseconds
所有请求在62毫秒内完成
42105.26 requests per second
每秒处理42105.26次请求
[root@localhost ~]# redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000 -d 100 -q
PING_INLINE: 34506.55 requests per second
PING_BULK: 34059.95 requests per second
SET: 31959.09 requests per second
GET: 31466.33 requests per second
INCR: 33311.12 requests per second
LPUSH: 29265.44 requests per second
LPOP: 36968.58 requests per second
SADD: 32030.75 requests per second
SPOP: 33344.45 requests per second
LPUSH (needed to benchmark LRANGE): 29735.36 requests per second
LRANGE_100 (first 100 elements): 16116.04 requests per second
LRANGE_300 (first 300 elements): 6659.56 requests per second
LRANGE_500 (first 450 elements): 4108.29 requests per second
相关文章推荐
- Redis性能测试——redis-benchmark使用教程
- BizTalk性能测试(一)——BizTalk Benchmark Wizard 安装及使用
- redis-benchmark 测试redis性能
- Redis学习笔记(十一)Redis-benchmark为Redis性能测试工具
- 深入理解Spring Redis的使用 (九)、通过Redis 实现 分布式锁 的 BUG,以及和数据库加锁的性能测试
- Redis-benchmark测试Redis性能
- redis-benchmark测试并发性能
- redis性能测试(redis-benchmark)
- SCPPO(十七):Redis在项目中的使用及性能测试
- 使用Python绘制Nginx,Redis等的性能测试图表
- Redis-benchmark测试Redis性能
- 十分简单的redis使用说明及性能测试
- Redis-benchmark测试Redis性能
- Redis源码分析(十三)--- redis-benchmark性能测试
- SCPPO(十八):Redis在项目中的使用及性能测试(续)
- [原创]Redis-benchmark 性能测试工具介绍
- 简单的redis使用说明及性能测试
- 十分简单的redis使用说明及性能测试
- Benchmark Web App 性能瓶颈分析与性能测试工具的使用方法总结
- Redis性能测试工具benchmark简介