【发布时间】:2015-07-22 12:06:51
【问题描述】:
我有一个由 3 个主节点版本 3.0.3 组成的 Redis 集群,托管在 3 个 EC2 t2.medium 实例上。当我坐在第四个实例上使用redis-benchmark 测量 SET、GET 性能时,我有
$ redis-benchmark -h redis-com-01 -p 6379 -t set,get -n 1000000
====== SET ======
...
33550.29 requests per second
====== GET ======
...
32353.04 requests per second
$ redis-benchmark -h redis-com-02 -p 6379 -t set,get -n 1000000
====== SET ======
...
36329.29 requests per second
====== GET ======
...
37199.61 requests per second
$ redis-benchmark -h redis-com-03 -p 6379 -t set,get -n 1000000
====== SET ======
...
32338.39 requests per second
====== GET ======
...
32169.86 requests per second
但是,当我使用来自https://github.com/Grokzen/redis-py-cluster 的基准工具simple.py 来测量整个集群的SET、GET 性能时,我对结果感到非常惊讶
$ python simple.py --host redis-com-03 --port 6379 --timeit
10k SET/GET operations took: 4.3375210762 seconds... 2305.46430192 operations per second
20k SET/GET operations took: 8.5704600811 seconds... 2333.59700772 operations per second
40k SET/GET operations took: 17.3284561634 seconds... 2308.34181781 operations per second
我已经按照清单http://redis.io/topics/latency 进行了操作。所有节点都配置了AOF,每秒fsync。 写入性能的差异对我来说是莫名其妙的。有人可以给我一个线索为什么以及是否可以解决这个问题?欢迎任何帮助。
【问题讨论】:
标签: python amazon-ec2 redis cluster-computing database-performance