在这种用例中,我们应该如何调整系统或内核(特别是Red Hat Linux,Fedora,CentOS)来优化场景?使用极少的本地磁盘I / O来最小化延迟,减少上下文切换.
会话长度可以是持久的(因为客户端的数量只是几个),数据大小互换很小,但非常频繁,如每秒1k到2k的消息,大小从40到100字节.
性能调整既是一门黑色艺术,也是一门科学.已经有关于它的完整书籍,包括很多作为 vendor documentation的一部分您首先要进行良好的监控,添加负载,获得基线,然后才开始调整并观察您的调整是否达到预期结果.
冲洗并重复,直到获得最佳结果.您没有提到您的主要RHEL或CentOS版本,但它们都包括自动调整,例如调谐后的守护进程.可以从tuned-adm列表中选择预定义的性能配置文件,然后使用tune-adm配置文件< profile-name>激活.
对于您的用例,RHEL 7配置文件latency-performance
听起来像您可能受益的那个:
This profile favors performance over power savings by setting
latency-performance
A server profile focused on lowering latency. This profile is recommended for latency-sensitive workloads that benefit from c-state tuning and the increased TLB efficiency of transparent huge pages.intel_pstate
andmax_perf_pct=100
. It enables transparent huge pages, usescpupower
to set the performance cpufreq governor, and requests acpu_dma_latency
value of1
.
对于更一般的Linux调优Brandan Gregg已经制作了许多可视化图表,用于在系统的哪个部分使用哪个工具制作非常好的备忘单:
工具:
在sar中使用哪些选项来监控:
密切相关:
将观察结果转换为调整:
精彩评论