一、背景
验证系统调优对性能的影响,用sysbench做了一些简单的测试,具体调整方法可见官方文档
二、特殊说明
1.透明大页查看
# 查看透明大页是否开启,[]在always处表示开启,[]在never处表示关闭
cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
2.io查看
io调度方式需要看磁盘类型是否支持,只有ssd和hdd的才能够支持noop的调度方式,具体可以看大佬的文章
三、结果对比
初步关闭了大页之后性能有5%左右的提升,但是因为测试环境比较差,测试内容不一定准确
1:
transactions: 2428 (40.45 per sec.)
queries: 48560 (809.03 per sec.)
2:
transactions: 3816 (63.57 per sec.)
queries: 76320 (1271.34 per sec.)
4:
transactions: <span class="token number">5851</span> <span class="token punctuation">(</span><span class="token number">97.47</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">117020</span> <span class="token punctuation">(</span><span class="token number">1949.30</span> per sec.<span class="token punctuation">)</span>
8:
transactions: 6918 (115.23 per sec.)
queries: 138360 (2304.62 per sec.)
16:
transactions: 8089 (134.54 per sec.)
queries: 161780 (2690.83 per sec.)
32:
transactions: <span class="token number">9120</span> <span class="token punctuation">(</span><span class="token number">151.51</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">182400</span> <span class="token punctuation">(</span><span class="token number">3030.21</span> per sec.<span class="token punctuation">)</span>
64:
transactions: <span class="token number">9153</span> <span class="token punctuation">(</span><span class="token number">151.65</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">183060</span> <span class="token punctuation">(</span><span class="token number">3032.96</span> per sec.<span class="token punctuation">)</span>
调整大页等参数后
1:
transactions: 2599 (43.30 per sec.)
queries: 51980 (865.99 per sec.)
2:
transactions: <span class="token number">4097</span> <span class="token punctuation">(</span><span class="token number">68.24</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">81940</span> <span class="token punctuation">(</span><span class="token number">1364.88</span> per sec.<span class="token punctuation">)</span>
4:
transactions: <span class="token number">6166</span> <span class="token punctuation">(</span><span class="token number">102.70</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">123320</span> <span class="token punctuation">(</span><span class="token number">2054.04</span> per sec.<span class="token punctuation">)</span>
8:
transactions: <span class="token number">8865</span> <span class="token punctuation">(</span><span class="token number">147.62</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">177300</span> <span class="token punctuation">(</span><span class="token number">2952.45</span> per sec.<span class="token punctuation">)</span>
16:
transactions: <span class="token number">9705</span> <span class="token punctuation">(</span><span class="token number">161.57</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">194100</span> <span class="token punctuation">(</span><span class="token number">3231.44</span> per sec.<span class="token punctuation">)</span>
32:
transactions: <span class="token number">9805</span> <span class="token punctuation">(</span><span class="token number">163.09</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">196100</span> <span class="token punctuation">(</span><span class="token number">3261.73</span> per sec.<span class="token punctuation">)</span>
64:
transactions: <span class="token number">10055</span> <span class="token punctuation">(</span><span class="token number">166.87</span> per sec.<span class="token punctuation">)</span>
queries: <span class="token number">201100</span> <span class="token punctuation">(</span><span class="token number">3337.38</span> per sec.<span class="token punctuation">)</span>
</article>