有没有办法使用命令行应用程序在 Ubuntu 服务器上禁用 Intel SpeedStep 步进?

Mic*_*eyn 4 linux performance ubuntu

我们不能使用 BIOS 禁用它,因为 Turbo 会被关闭以及产生副作用(多么糟糕的 BIOS!)。我正在为 Ubuntu 12.04 LTS Server 寻找一个可以执行此操作的简单命令行工具。

我知道在 Windows 上,如果您将电源选项设置为高性能,SpeedStep 将被禁用,但是我如何使用命令行应用程序在 Ubuntu Linux 上执行此操作?

Bru*_*ira 9

Ubuntu 内核附带 CPU 控制调节器,通常设置为ondemand它们将调节 Ubuntu 系统中 CPU 的性能。

您可以更改 Ubuntu 中每个逻辑 CPU 的 CPU 性能设置。

首先阅读系统当前可用的设置:

sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
Run Code Online (Sandbox Code Playgroud)

这将返回一个可用设置列表,您可以使用它来调节 CPU 的每个内核,如果可以,您应该通过选择该performance选项将它们设置为最大性能。这将使您的 CPU 内核始终以最大频率运行。

知道您有哪些选项以及该performance选项是否可用,您可以performance使用以下命令将每个核心设置为模式:

sudo echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Run Code Online (Sandbox Code Playgroud)

这将使cpu0(第一核)始终以最大性能运行。为 CPU 中的所有逻辑内核执行此操作。

然后,您可以使用以下命令检查该选项是否已成功更改:

sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Run Code Online (Sandbox Code Playgroud)

这将检查cpu0(第一核)的当前设置选项。检查所有内核的更改是否成功,如果一切设置正确,您就可以开始了:英特尔 SpeedStep 将开启,但您的所有内核将始终以最大频率速度运行。

然后,您可以使用Universe 存储库中cpufreq-info的包检查并获取有关实际频率cpufrequtils的信息,它将报告每个核心的实际速度和许多其他信息,包括设置调节器,但您需要先使用命令安装它sudo apt-get install cpufrequtils

cpufreq-信息

cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: powernow-k8
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 8.0 us.
  hardware limits: 800 MHz - 3.00 GHz
  available frequency steps: 3.00 GHz, 2.30 GHz, 1.80 GHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 800 MHz and 3.00 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz.
  cpufreq stats: 3.00 GHz:10.45%, 2.30 GHz:0.29%, 1.80 GHz:1.72%, 800 MHz:87.55%  (28605)
Run Code Online (Sandbox Code Playgroud)

  • `sudo sh -c "echo Performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"` 对我有用,否则会出现权限错误。 (2认同)