欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Redis 2.4与2.6 性能比较

程序员文章站 2022-05-20 22:58:39
...

在写基于Mysql Binlog刷新redis缓存的项目时,刚完成部分功能开发,整个流程走通了。突然发现测试机自己安装了redis2.4.2与redis

今天在写基于Mysql Binlog刷新redis缓存的项目时,刚完成部分功能开发,整个流程走通了。突然发现测试机自己安装了redis2.4.2与redis2.6.2两个版本,因此顺手想在测试机上跑下redis相关性能,看有多大的提高:

测试程序是redis自已的redis-benchmark, 参数为:src/redis-benchmark -h host -p port -c 10 -n 100000 -q

Intel(R) Xeon(TM) CPU 2.80GHz 4核,,2G内存:

首先是redis2.4.2:

PING_INLINE: 41305.25 requests per second
PING_BULK: 41649.31 requests per second
SET: 42016.81 requests per second
GET: 41788.55 requests per second
INCR: 41823.50 requests per second
LPUSH: 36179.45 requests per second
LPOP: 41067.76 requests per second
SADD: 41823.50 requests per second
SPOP: 41305.25 requests per second
LPUSH (needed to benchmark LRANGE): 41254.12 requests per second
LRANGE_100 (first 100 elements): 17618.04 requests per second
LRANGE_300 (first 300 elements): 6311.94 requests per second
LRANGE_500 (first 450 elements): 4240.16 requests per second
LRANGE_600 (first 600 elements): 3283.75 requests per second
MSET (10 keys): 24667.00 requests per second

redis.2.6.2:

PING_INLINE: 40849.67 requests per second
PING_BULK: 40371.42 requests per second
SET: 41339.39 requests per second
GET: 41118.42 requests per second
INCR: 41169.21 requests per second
LPUSH: 40144.52 requests per second
LPOP: 41580.04 requests per second
SADD: 42069.84 requests per second
SPOP: 42462.84 requests per second
LPUSH (needed to benchmark LRANGE): 41511.00 requests per second
LRANGE_100 (first 100 elements): 17337.03 requests per second
LRANGE_300 (first 300 elements): 6483.82 requests per second
LRANGE_500 (first 450 elements): 4253.15 requests per second
LRANGE_600 (first 600 elements): 2835.27 requests per second
MSET (10 keys): 19047.62 requests per second

从上面两者所跑数据比较来看,基本上相差不大。redis2.6.2 操作性能甚至有细微的下降,有些又有少量的性能增加。

redis2.6.2新功能介绍 中提到了性能相关的主要有一个是AOF性能的提升以及大数据存储时性能提升。因此相关基本操作,redis在之前版本已经很极致了。

以上数据仅供参考!

Redis 2.4与2.6 性能比较