我需要一些关于如何为我的应用程序增加Redis性能和CPU利用率的想法。
我有2个环境,分期和制作。请注意,这两个都是虚拟机。
生产是一个12核系统,具有以下规格:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 37
model name : Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
stepping : 1
microcode : 1808
cpu MHz : 2200.000
cache size : 20480 KB
Staging是一个4核系统,具有以下规格:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 37
model name : Intel(R) Xeon(R) CPU X5690 @ 3.47GHz
stepping : 1
microcode : 21
cpu MHz : 3466.789
cache size : 12288 KB
但是,我的生产环境中的Redis基准测试得分要低得多:
PRODUCTION::[c./redis-benchmark -q -n 100000
PING_INLINE: 30911.90 requests per second
PING_BULK: 31065.55 requests per second
SET: 27247.96 requests per second
GET: 33760.97 requests per second
INCR: 34843.21 requests per second
LPUSH: 33178.50 requests per second
LPOP: 32154.34 requests per second
SADD: 37608.12 requests per second
SPOP: 38491.14 requests per second
LPUSH (needed to benchmark LRANGE): 35161.74 requests per second
LRANGE_100 (first 100 elements): 22773.86 requests per second
LRANGE_300 (first 300 elements): 12312.24 requests per second
LRANGE_500 (first 450 elements): 9775.17 requests per second
LRANGE_600 (first 600 elements): 7113.39 requests per second
MSET (10 keys): 29708.85 requests per second
与登台环境相比:
SIT [cdmxa@cdmapp01d bin]$ ./redis-benchmark -q -n 100000
PING_INLINE: 165016.50 requests per second
PING_BULK: 163132.14 requests per second
SET: 142653.36 requests per second
GET: 157480.31 requests per second
INCR: 161550.89 requests per second
LPUSH: 151515.14 requests per second
LPOP: 153374.23 requests per second
SADD: 163934.42 requests per second
SPOP: 161030.59 requests per second
LPUSH (needed to benchmark LRANGE): 151057.41 requests per second
LRANGE_100 (first 100 elements): 65359.48 requests per second
LRANGE_300 (first 300 elements): 23137.44 requests per second
LRANGE_500 (first 450 elements): 16714.02 requests per second
LRANGE_600 (first 600 elements): 12904.89 requests per second
MSET (10 keys): 72674.41 requests per second
还注意到生产环境中的CPU利用率非常低:
由于只是CPU,redis基准测试是否如此之低,还是还有其他因素导致这种情况发生?
有关我可以采取哪些措施来提高绩效的建议?
谢谢!
更新(4月7日): 两台服务器上的Redis版本是相同的。