Redis的效能與CPU主頻的關係
背景
最近想驗證一下不同主頻下 CPU效能相關內容.
本來想開啟一個高主頻的 虛擬機器
但是經過自己一翻 百度 bing
發現大部分資料告知我
虛擬機器沒法調整主頻.
WTF 只能用物理機來進行相關的處理.
經過十分鐘的努力
得出結論
Redis的效能在相同架構, 相同型號的CPU上面
與主頻的大小成等比率關係.
物理機的基本資訊獲取
伺服器配置:
鯤鵬920 2.6G 1T記憶體
具體資訊:
frequency-info --policy
analyzing CPU 0:
current policy: frequency should be within 1000 MHz and 2.60 GHz.
The governor "performance" may decide which speed to use
within this range.
cpupower -c all frequency-info
analyzing CPU 127:
driver: cppc_cpufreq
CPUs which run at the same hardware frequency: 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
CPUs which need to have their frequency coordinated by software: 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
maximum transition latency: Cannot determine or is not supported.
hardware limits: 200 MHz - 2.60 GHz
available cpufreq governors: conservative ondemand userspace powersave performance
current policy: frequency should be within 1000 MHz and 2.60 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: 2.60 GHz (asserted by call to hardware)
設定CPU頻率的方式
cpupower -c all frequency-set -f 2.5Ghz
cpupower -c all frequency-set -f 2.0Ghz
cpupower -c all frequency-set -f 1.0Ghz
預設情況 -2.6G
PING_INLINE: 130378.09 requests per second, p50=0.087 msec
PING_MBULK: 142045.45 requests per second, p50=0.079 msec
SET: 132275.14 requests per second, p50=0.079 msec
GET: 84245.99 requests per second, p50=0.119 msec
INCR: 95147.48 requests per second, p50=0.111 msec
LPUSH: 97656.24 requests per second, p50=0.111 msec
RPUSH: 89686.10 requests per second, p50=0.111 msec
LPOP: 100603.62 requests per second, p50=0.103 msec
RPOP: 113250.28 requests per second, p50=0.095 msec
SADD: 78308.54 requests per second, p50=0.151 msec
HSET: 85251.49 requests per second, p50=0.127 msec
SPOP: 82918.74 requests per second, p50=0.119 msec
ZADD: 97656.24 requests per second, p50=0.111 msec
ZPOPMIN: 76804.91 requests per second, p50=0.151 msec
LPUSH (needed to benchmark LRANGE): 91743.12 requests per second, p50=0.127 msec
LRANGE_100 (first 100 elements): 47709.93 requests per second, p50=0.215 msec
LRANGE_300 (first 300 elements): 20259.32 requests per second, p50=0.495 msec
LRANGE_500 (first 500 elements): 13563.00 requests per second, p50=0.735 msec
LRANGE_600 (first 600 elements): 11558.02 requests per second, p50=0.863 msec
MSET (10 keys): 89126.56 requests per second, p50=0.191 msec
2.5Ghz
PING_INLINE: 103519.66 requests per second, p50=0.111 msec
PING_MBULK: 94161.95 requests per second, p50=0.119 msec
SET: 81499.59 requests per second, p50=0.111 msec
GET: 90579.71 requests per second, p50=0.119 msec
INCR: 84388.19 requests per second, p50=0.119 msec
LPUSH: 89605.73 requests per second, p50=0.127 msec
RPUSH: 85470.09 requests per second, p50=0.127 msec
LPOP: 75244.55 requests per second, p50=0.151 msec
RPOP: 92165.90 requests per second, p50=0.111 msec
SADD: 70671.38 requests per second, p50=0.159 msec
HSET: 83892.62 requests per second, p50=0.151 msec
SPOP: 78431.38 requests per second, p50=0.119 msec
ZADD: 94161.95 requests per second, p50=0.111 msec
ZPOPMIN: 82987.55 requests per second, p50=0.119 msec
LPUSH (needed to benchmark LRANGE): 75987.84 requests per second, p50=0.151 msec
LRANGE_100 (first 100 elements): 42698.55 requests per second, p50=0.223 msec
LRANGE_300 (first 300 elements): 19500.78 requests per second, p50=0.511 msec
LRANGE_500 (first 500 elements): 12861.74 requests per second, p50=0.767 msec
LRANGE_600 (first 600 elements): 10757.32 requests per second, p50=0.927 msec
MSET (10 keys): 84104.29 requests per second, p50=0.215 msec
2Ghz
PING_INLINE: 99601.60 requests per second, p50=0.111 msec
PING_MBULK: 84745.77 requests per second, p50=0.111 msec
SET: 57736.72 requests per second, p50=0.175 msec
GET: 57306.59 requests per second, p50=0.175 msec
INCR: 62853.55 requests per second, p50=0.175 msec
LPUSH: 66533.60 requests per second, p50=0.175 msec
RPUSH: 65659.88 requests per second, p50=0.175 msec
LPOP: 65530.80 requests per second, p50=0.175 msec
RPOP: 73964.50 requests per second, p50=0.175 msec
SADD: 69589.42 requests per second, p50=0.151 msec
HSET: 58892.82 requests per second, p50=0.191 msec
SPOP: 59630.29 requests per second, p50=0.183 msec
ZADD: 64308.68 requests per second, p50=0.175 msec
ZPOPMIN: 62073.25 requests per second, p50=0.175 msec
LPUSH (needed to benchmark LRANGE): 66533.60 requests per second, p50=0.175 msec
LRANGE_100 (first 100 elements): 34710.17 requests per second, p50=0.303 msec
LRANGE_300 (first 300 elements): 15441.63 requests per second, p50=0.623 msec
LRANGE_500 (first 500 elements): 10209.29 requests per second, p50=0.975 msec
LRANGE_600 (first 600 elements): 8775.78 requests per second, p50=1.087 msec
MSET (10 keys): 60024.01 requests per second, p50=0.287 msec
1Ghz
PING_INLINE: 43554.01 requests per second, p50=0.223 msec
PING_MBULK: 31625.55 requests per second, p50=0.319 msec
SET: 33322.23 requests per second, p50=0.335 msec
GET: 33523.30 requests per second, p50=0.311 msec
INCR: 33829.50 requests per second, p50=0.327 msec
LPUSH: 33978.93 requests per second, p50=0.335 msec
RPUSH: 33932.81 requests per second, p50=0.327 msec
LPOP: 34013.61 requests per second, p50=0.335 msec
RPOP: 33681.38 requests per second, p50=0.327 msec
SADD: 34423.41 requests per second, p50=0.311 msec
HSET: 34614.05 requests per second, p50=0.327 msec
SPOP: 32808.40 requests per second, p50=0.319 msec
ZADD: 33344.45 requests per second, p50=0.335 msec
ZPOPMIN: 32840.72 requests per second, p50=0.319 msec
LPUSH (needed to benchmark LRANGE): 33772.38 requests per second, p50=0.335 msec
LRANGE_100 (first 100 elements): 18112.66 requests per second, p50=0.567 msec
LRANGE_300 (first 300 elements): 7702.38 requests per second, p50=1.279 msec
LRANGE_500 (first 500 elements): 5110.91 requests per second, p50=1.927 msec
LRANGE_600 (first 600 elements): 4385.20 requests per second, p50=2.247 msec
MSET (10 keys): 32927.23 requests per second, p50=0.543 msec
測試結果總結--效能絕對值
測試結果總結--效能比率