Redis 高级教程 Redis 基准(3)

Redis 的基准是实用程序运行 n 个命令检查 Redis 的性能。

语法

Redis 的基准的基本语法如下所示:

redis-benchmark [option] [option value]

例子

下面给出的例子调用 100000 命令检查 redis。

redis-benchmark -n 100000

PING_INLINE: 141043.72 requests per second

PING_BULK:142857.14 requests per second

SET:141442.72 requests per second

GET:145348383 requests per second

INCR:137362.64 requests per second

LPUSH:145348.83 requests per second

LPOP:146198.83 requests per second

SADD:146198.83 requests per second 

SPOP:149253.73 requests per second

LPUSH (needed to benchmark LRANGE):148588.42 requests per second

LRANGE_100 (first 100 elements):58411.21 requests per second

LRANGE_300 (first 300 elements):21195.42 requests per second

LRANGE_500 (first 450 elements):14539.11 requests per second

LRANGE_600 (first 600 elements):10504.20 requests per second

MSET (10 keys): 93283.58 requests per second

Redis 的基准由许多可供选择,分裂如下:

S.N. 选项 描述 默认值
1 -h 指定服务器的主机名 127.0.0.1
2 -p 指定服务器端口 6379
3 -s 知道你过服务器套接字  
4 -c 指定并行连接数 50
5 -n 指定请求总数 10000
6 -d 指定以字节为单位设置/获取值的数据大小 2
7 -k 1=保持活动 0-重新连接 1
8 -r 使用随机键对 SET/GET/INCR,随机 SADD 值  
9 -p 管道 <numreq> 请求 1
10 -h 指定服务器的主机名  
11 -q Redis轻质安静操作。只显示查询/秒值  
12 -csv 输出为 CSV 格式  
13 -I 产生循环,永远运行测试  
14 -t 只有运行的逗号分隔的测试列表  

 

posted @ 2016-11-02 14:51  jinbao.wang  阅读(234)  评论(0编辑  收藏  举报