Linux 內設定 CPU 頻率的方式
- 安裝環境 Debian 12.1
安裝方式
apt install cpufrequtils
使用方式
- 查詢目前 CPU 個核心執行頻率 cpufreq-info 看結果
# cpufreq-info cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009 Report errors and bugs to [email protected], please. analyzing CPU 0: driver: intel_pstate CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: 4294.55 ms. hardware limits: 400 MHz - 4.50 GHz available cpufreq governors: performance, powersave current policy: frequency should be within 400 MHz and 4.50 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency is 2.70 GHz. analyzing CPU 1: driver: intel_pstate CPUs which run at the same hardware frequency: 1 CPUs which need to have their frequency coordinated by software: 1 maximum transition latency: 4294.55 ms. hardware limits: 400 MHz - 4.50 GHz available cpufreq governors: performance, powersave current policy: frequency should be within 400 MHz and 4.50 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency is 2.70 GHz. analyzing CPU 2: driver: intel_pstate CPUs which run at the same hardware frequency: 2 CPUs which need to have their frequency coordinated by software: 2 maximum transition latency: 4294.55 ms. hardware limits: 400 MHz - 4.50 GHz available cpufreq governors: performance, powersave current policy: frequency should be within 400 MHz and 4.50 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency is 2.70 GHz. analyzing CPU 3: driver: intel_pstate CPUs which run at the same hardware frequency: 3 CPUs which need to have their frequency coordinated by software: 3 maximum transition latency: 4294.55 ms. hardware limits: 400 MHz - 4.50 GHz available cpufreq governors: performance, powersave current policy: frequency should be within 400 MHz and 4.50 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency is 1.40 GHz. analyzing CPU 4: driver: intel_pstate CPUs which run at the same hardware frequency: 4 CPUs which need to have their frequency coordinated by software: 4 maximum transition latency: 4294.55 ms. hardware limits: 400 MHz - 4.50 GHz available cpufreq governors: performance, powersave current policy: frequency should be within 400 MHz and 4.50 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency is 1.40 GHz. analyzing CPU 5: driver: intel_pstate CPUs which run at the same hardware frequency: 5 CPUs which need to have their frequency coordinated by software: 5 maximum transition latency: 4294.55 ms. hardware limits: 400 MHz - 4.50 GHz available cpufreq governors: performance, powersave current policy: frequency should be within 400 MHz and 4.50 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency is 1.34 GHz. analyzing CPU 6: driver: intel_pstate CPUs which run at the same hardware frequency: 6 CPUs which need to have their frequency coordinated by software: 6 maximum transition latency: 4294.55 ms. hardware limits: 400 MHz - 4.50 GHz available cpufreq governors: performance, powersave current policy: frequency should be within 400 MHz and 4.50 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency is 2.70 GHz. analyzing CPU 7: driver: intel_pstate CPUs which run at the same hardware frequency: 7 CPUs which need to have their frequency coordinated by software: 7 maximum transition latency: 4294.55 ms. hardware limits: 400 MHz - 4.50 GHz available cpufreq governors: performance, powersave current policy: frequency should be within 400 MHz and 4.50 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency is 2.70 GHz.
- 設定 CPU 運行模式 powersave(省電模式), userspace(使用者自訂), ondemand(自動調整), conservative(保守模式), performance(高效能模式) Exp. 設定為 powersave
echo "GOVERNOR=\"powersave\"" > /etc/default/cpufrequtils systemctl restart cpufrequtils