-
Notifications
You must be signed in to change notification settings - Fork 82
Redis 代理性能测试
Neuron Teckid edited this page Jan 16, 2015
·
1 revision
测试脚本: https://gist.github.com/neuront/2e33e253c0b877baa5c0
测试方案: 并发 1, 5, 20, 40, 80 进程执行该脚本, 分别连接单点 redis-server 和 cerberus + 3 节点集群以及 cerberus + 6 节点集群; 集群无从节点; 不开启 AOF/RDB (其中 cerberus + 6 节点集群不测试 1, 5, 20 并发); 1, 5, 20, 40 并发的情况各执行 4 次测试, 80 并发的情况各执行 3 次测试
测试机器: 8 核; 内存 64G
测试结果
分别统计了 keys 操作, list 操作, hash 操作和单个进程执行的最短, 最长, 平均执行时间, 以及单节点和集群效率对比
1 并发
Test| Single Redis | Cerberus + Cluster |
set | Min Max Avg | Min Max Avg | Ratio
----+-------+-------+-------+--------+--------+--------+------
keys|16.8164|16.8425|16.8295| 28.9120| 29.0358| 28.9739|58.08%
hash|23.6243|23.7699|23.6971| 40.9100| 41.0045| 40.9572|57.86%
list|20.1631|20.3751|20.2691| 34.7315| 34.9765| 34.8540|58.15%
proc|60.7756|60.8158|60.7957|104.5535|105.0168|104.7852|58.02%
5 并发
Test| Single Redis | Cerberus + Cluster |
set | Min Max Avg | Min Max Avg | Ratio
----+-------+-------+-------+--------+--------+--------+------
keys|18.4632|20.3394|19.1054| 31.3132| 31.6343| 31.4764|60.70%
hash|25.9158|29.3655|26.8482| 44.9500| 45.3819| 45.1281|59.49%
list|22.3009|25.9181|23.5657| 38.1673| 38.6318| 38.3444|61.46%
proc|66.8403|75.2668|69.5192|114.4498|115.5075|114.9488|60.48%
20 并发
Test| Single Redis | Cerberus + Cluster |
set | Min Max Avg | Min Max Avg | Ratio
----+--------+--------+--------+--------+--------+--------+------
keys| 34.4731| 37.3420| 36.2796| 44.3241| 50.9046| 47.1710|76.91%
hash| 48.9412| 54.0943| 52.2162| 61.0959| 71.9526| 66.4282|78.61%
list| 41.1683| 46.0312| 44.4179| 52.5280| 61.4421| 57.5142|77.23%
proc|127.1197|135.6044|132.9137|160.8032|180.1243|171.1134|77.68%
40 并发
Test| Single Redis | Cerberus + Cluster (3) | | Cerberus + Cluster (6) |
set | Min Max Avg | Min Max Avg | Ratio| Min Max Avg | Ratio
----+--------+--------+--------+--------+--------+--------+------+--------------------------+------
keys| 56.8374| 63.3964| 60.7844| 61.5923| 78.0628| 67.6129|89.90%| 61.4525| 78.5714| 66.5899|91.28%
hash| 85.8949| 92.0656| 88.4763| 88.3697|105.5562| 94.4589|93.67%| 86.2180|106.4163| 94.2607|93.86%
list| 70.9977| 76.8872| 73.8700| 75.2977| 89.9390| 81.2637|90.90%| 76.2006| 89.8452| 81.5218|90.61%
proc|216.6412|228.4524|223.1307|232.2839|256.5152|243.3354|91.70%|227.2717|254.9637|242.3724|92.06%
80 并发
Test| Single Redis | Cerberus + Cluster (3) | | Cerberus + Cluster (6) |
set | Min Max Avg | Min Max Avg | Ratio | Min Max Avg | Ratio
----+--------+--------+--------+--------+--------+--------+-------+--------------------------+-------
keys| 99.8194|112.7003|107.1874|110.5938|122.6294|115.9326| 92.46%|100.4798|112.3938|106.6004|100.55%
hash|156.6915|177.4140|166.7902|149.0238|170.0404|159.3924|104.64%|142.9672|163.3602|151.4179|110.15%
list|127.9113|148.4957|136.5105|127.8014|145.7953|135.6736|100.62%|121.1681|140.4851|132.1533|103.30%
proc|394.5177|431.2737|410.4881|398.2425|423.9531|410.9986| 99.88%|375.8392|407.4943|390.1716|105.21%