目录

服务器性能调优再谈

misaraty 更新 | 2024-10-02
前言
  • 之前的《服务器性能调优》解决了6242R节点表现不佳的问题。

  • 为提升服务器高性能计算的效率,除了关闭超线程,还有哪些措施呢?

INTEL平台1

BIOS Settings

  • Hyperthreading = Off

  • Profile = Maximum Performance

OS Settings

  • processor.max_cstate = 1

  • intel_idle.max_cstate = 0

  • iommu = pt

  • mitigations = off

In the last few years, a family of new security vulnerabilities was discovered affecting many CPUs made by all major CPU makers. Sadly, patching these vulnerabilities had the side effect of a huge performance impact that can reach up to a ~%25 decrease in some workloads.

New CPUs (mostly the ones released after 2020) often do not suffer from such vulnerabilities nor from the highly performance-impacting patches to fix them. However, for a lot of older CPUs, your Linux system performance may be taking a considerable performance penalty to remain secure from such vulnerability exploits.2

  • clear caches
1
2
3
4
5
6
# 清除页面缓存:
echo 1 > /proc/sys/vm/drop_caches
# 清除目录项和索引节点缓存:
echo 2 > /proc/sys/vm/drop_caches
# 同时清除页面缓存、目录项和索引节点缓存:
echo 3 > /proc/sys/vm/drop_caches
  • NUMA Balancing = 0

  • randomize_va_space = 0

  • THP = ON

  • CPU Governor = Performance

AMD平台1

BIOS Settings

  • SMT = OFF

  • NPS = 4

  • Determinism = Power

OS Settings

  • amd_iommu = ON

  • iommu = pt

  • mitigations = off

  • clear caches

  • NUMA balancing = 0

  • THP = on

  • CPU governor = Performance

  • C2 states = disabled

极客湾

1
2
3
4
5
-SMT = OFF
NPS = 4
I0MMU = ON
mitigations = off
NUMA balancing = 0

  1. MOLECULAR DYNAMICS ON AMD EPYC™ 9754 PROCESSORS MOLECULAR DYNAMICS ↩︎

  2. How to Disable CPU Mitigations on Linux ↩︎