码迷,mamicode.com
首页 > 其他好文 > 详细

Redis性能测试

时间:2016-02-21 18:42:49      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:redis

Redis自带redis-benchmark测试工具用来测试Redis的性能,redis-benchmark可以模拟多个客户端同时发送多个请求。


Usage: redis-benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-k <boolean>]


-q 静默模式,只显示requests per second的值

-n 总共发起的请求数量



1.向6379这个redis实例发送500000个请求数

redis-benchmark -p 6379 -q  -n 500000
PING_INLINE: 66365.81 requests per second
PING_BULK: 61440.16 requests per second
SET: 55401.66 requests per second
GET: 66693.34 requests per second
INCR: 62790.41 requests per second
LPUSH: 57836.90 requests per second
LPOP: 68587.11 requests per second
SADD: 69280.87 requests per second
SPOP: 69803.16 requests per second
LPUSH (needed to benchmark LRANGE): 69473.39 requests per second
LRANGE_100 (first 100 elements): 35216.23 requests per second
LRANGE_300 (first 300 elements): 15170.36 requests per second
LRANGE_500 (first 450 elements): 10984.18 requests per second
LRANGE_600 (first 600 elements): 8499.21 requests per second
MSET (10 keys): 44980.21 requests per second



2.只测试几个命令

redis-benchmark -p 26379 -q  -n 500000  -t set,get,mset


3.选择key space的大小


本文出自 “Linux SA John” 博客,请务必保留此出处http://john88wang.blog.51cto.com/2165294/1743805

Redis性能测试

标签:redis

原文地址:http://john88wang.blog.51cto.com/2165294/1743805

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!