ntpd.service - Network Time Service Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled) Active: active (running) since 一 2017-12-18 13:13:19 CST; 3s ago
若返回报错信息 Unit ntpd.service could not be found.,请尝试执行以下命令,以查看与 NTP 进行时钟同步所使用的系统配置是 chronyd 还是 ntpd:
sudo systemctl status chronyd.service
chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2021-04-05 09:55:29 EDT; 3 days ago
analyzing CPU 0: current policy: frequency should be within 1.20 GHz and 3.10 GHz. The governor "powersave" may decide which speed to use within this range.
注意
The governor "powersave" 表示 cpufreq 的节能策略使用 powersave,需要调整为 performance 策略。如果是虚拟机或者云主机,则不需要调整,命令输出通常为 Unable to determine current policy。
配置系统优化参数
方法一:使用 tuned(推荐)
执行 tuned-adm list 命令查看当前操作系统的 tuned 策略。
tuned-adm list
Available profiles: - balanced - General non-specialized tuned profile - desktop - Optimize for the desktop use-case - hpc-compute - Optimize for HPC compute workloads - latency-performance - Optimize for deterministic performance at the cost of increased power consumption - network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance - network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks - powersave - Optimize for low power consumption - throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads - virtual-guest - Optimize for running inside a virtual guest - virtual-host - Optimize for running KVM guests Current active profile: balanced
Current active profile: balanced 表示当前操作系统的 tuned 策略使用 balanced,建议在当前策略的基础上添加操作系统优化配置。
创建新的 tuned 策略。
mkdir /etc/tuned/balanced-tidb-optimal/ vi /etc/tuned/balanced-tidb-optimal/tuned.conf
analyzing CPU 0: current policy: frequency should be within 1.20 GHz and 3.10 GHz. The governor "performance" may decide which speed to use within this range.