redis or ssdb
测试环境
1, 操作系统
centos7
内核:3.10.0-123.20.1.el7.x86_64
2, 内存:
grep MemTotal /proc/meminfo
MemTotal: 7138276 kB
3, 请求数 10000,并发clients 50
4,服务器版本信息
1,redis: Redis server v=3.2.1 sha=00000000:0 malloc=libc bits=64 build=939341c443eba189
2,ssdb: 1.9.4
redis-benchmark -n 10000 -c 50
====== PING_INLINE ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
31746.03 requests per second
====== PING_BULK ======
10000 requests completed in 0.29 seconds
3 bytes payload
keep alive: 1
34246.57 requests per second
====== SET ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
32679.74 requests per second
====== GET ======
10000 requests completed in 0.30 seconds
3 bytes payload
keep alive: 1
33222.59 requests per second
====== INCR ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
32051.28 requests per second
====== LPUSH ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
32679.74 requests per second
====== RPUSH ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
32154.34 requests per second
====== LPOP ======
10000 requests completed in 0.32 seconds
3 bytes payload
keep alive: 1
31152.65 requests per second
====== RPOP ======
10000 requests completed in 0.29 seconds
3 bytes payload
keep alive: 1
34843.21 requests per second
====== SADD ======
10000 requests completed in 0.32 seconds
3 bytes payload
keep alive: 1
31347.96 requests per second
====== SPOP ======
10000 requests completed in 0.30 seconds
3 bytes payload
keep alive: 1
33557.05 requests per second
====== LPUSH (needed to benchmark LRANGE) ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
31847.13 requests per second
====== LRANGE_100 (first 100 elements) ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
32258.06 requests per second
====== LRANGE_300 (first 300 elements) ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
32679.74 requests per second
====== LRANGE_500 (first 450 elements) ======
10000 requests completed in 0.33 seconds
3 bytes payload
keep alive: 1
30303.03 requests per second
====== LRANGE_600 (first 600 elements) ======
10000 requests completed in 0.31 seconds
3 bytes payload
keep alive: 1
32362.46 requests per second
====== MSET (10 keys) ======
10000 requests completed in 0.32 seconds
3 bytes payload
keep alive: 1
30959.75 requests per second
ssdb压测
========== set ==========
qps: 14691, time: 0.681 s
========== get ==========
qps: 20075, time: 0.498 s
========== del ==========
qps: 12913, time: 0.774 s
========== hset ==========
qps: 13218, time: 0.757 s
========== hget ==========
qps: 18534, time: 0.540 s
========== hdel ==========
qps: 12697, time: 0.788 s
========== zset ==========
qps: 8334, time: 1.200 s
========== zget ==========
qps: 17628, time: 0.567 s
========== zdel ==========
qps: 11980, time: 0.835 s
========== qpush ==========
qps: 8499, time: 1.177 s
========== qpop ==========
qps: 10060, time: 0.994 s
CPU 对比:
redis: 百分之十几到 七十几
ssdb: 15%-25%
内存对比:
redis: 0.0%
ssdb: 1%左右浮动 +-0.5
1,redis比较消耗cpu资源
2,ssdb cpu 内存资源较为稳定
3,redis ssdb查询优于redis , 更新略逊redis
ssdb基于磁盘存储,对于想要redis的查询性能,对写入性能不敏感,且担心内存溢出,可以考虑尝试ssdb
blog comments powered by Disqus