1 测试目的

了解redis在不同情况下的性能表现,并分析其性能瓶颈,找出相应的解决方案。

2 redis基准测试概览

运行下列命令可以了解自己的redis服务器的基本性能指标。
通过loopback进行redis基准测试时的结果:
root@redis bin]# ./redis-benchmark -c 1 -q
PING_INLINE: 24630.54 requests per second
PING_BULK: 25106.70 requests per second
SET: 25510.20 requests per second
GET: 25700.33 requests per second
INCR: 26164.31 requests per second
LPUSH: 22507.32 requests per second
RPUSH: 25163.56 requests per second
LPOP: 24189.65 requests per second
RPOP: 25188.92 requests per second
SADD: 26759.43 requests per second
HSET: 24679.17 requests per second
SPOP: 25940.34 requests per second
LPUSH (needed to benchmark LRANGE): 24606.30 requests per second
LRANGE_100 (first 100 elements): 18228.22 requests per second
LRANGE_300 (first 300 elements): 10919.42 requests per second
LRANGE_500 (first 450 elements): 9029.35 requests per second
LRANGE_600 (first 600 elements): 7458.79 requests per second
MSET (10 keys): 24330.90 requests per second

  

05-21 16:04