6

I have a server and I want to ensure it's always running at maximum speed, never in energy-saving mode. I've tried a few strategies (aside from rebooting and changing the setting in the bios, which I would have to do for a few hundred servers) but I'm getting weird results from cpufreq-info. E.g.:

root@host:~# cpufreq-info -c 0
cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 1.20 GHz - 2.20 GHz
  available frequency steps: 2.20 GHz, 2.20 GHz, 2.10 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 2.00 GHz and 2.20 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 1.20 GHz (asserted by call to hardware).
  cpufreq stats: 2.20 GHz:6.50%, 2.20 GHz:0.24%, 2.10 GHz:0.34%, 2.00 GHz:0.05%, 1.90 GHz:0.04%, 1.80 GHz:0.03%, 1.70 GHz:0.03%, 1.60 GHz:0.03%, 1.50 GHz:0.03%, 1.40 GHz:0.03%, 1.30 GHz:0.03%, 1.20 GHz:92.66%  (8080636)

Note that the min speed shows "2.00 GHz", and the governor is set to "performance", yet the current CPU frequency is 1.20 GHz. However, if I just look in /proc/cpuinfo, the value there is consistently ~2.2 GHz:

root@host:~# egrep 'MHz|Xeon' /proc/cpuinfo ; cpufreq-info -c 0
model name  : Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
cpu MHz     : 2200.000
model name  : Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
cpu MHz     : 2201.000

Which of these is correct? Which do I believe? Aside from the BIOS changes, is there any way to guarantee maximum performance mode? For what it's worth, this is Ubuntu 12.04, with this kernel:

Linux host 3.2.0-76-generic #111-Ubuntu SMP Tue Jan 13 22:16:09 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  • Doubtfully helpful but what is in /sys/devices/system/cpu/cpu0/cpufreq/bios_limit? – Mark Wagner Jul 8 '15 at 21:18
  • Also /sys/module/processor/parameters/ignore_ppc – Mark Wagner Jul 8 '15 at 22:05
  • @MarkWagner : root@host:~# cat /sys/devices/system/cpu/cpu30/cpufreq/bios_limit 2201000 root@host:~# cat /sys/devices/system/cpu/cpu30/cpufreq/scaling_governor performance root@host:~# cat /sys/devices/system/cpu/cpu30/cpufreq/cpuinfo_cur_freq 1200000 root@host:~# cat /sys/devices/system/cpu/cpu30/cpufreq/scaling_cur_freq 2201000 root@host:~# cat /sys/module/processor/parameters/ignore_ppc 0 – Evan Jul 9 '15 at 1:30
6

I'm almost convinced it your BIOS is limiting your CPUs to 1.20 GHz. In the kernel there are two values:

  1. scaling_cur_freq which is the frequency that the cpufreq driver thinks it has requested. /proc/cpuinfo contains this value. It calls the cpufreq_quick_get() funciton.

  2. cpuinfo_cur_freq which is the frequency that is actually programmed into the CPU. cpufreq-info is using this value as indicated by "asserted by call to hardware." (It eventually calls __cpufreq_get().) It would fall back to scaling_cur_freq if cpuinfo_cur_freq wasn't available.

+1 about Matt's comments on mass BIOS update. E.g., HP Proliant DL class servers allow you to change the power regulation online. Perhaps your hardware has similar functionality.

  • It's not limiting it to 1.2 GHz, it does respond to load and scale up to 2.2 GHz, but my workload is such that that's no good for me. I'd love to change the BIOS settings but in my environment it's just not feasible for a few reasons. – Evan Jul 9 '15 at 1:24
  • I mispoke. I didn't mean it was limiting it to 1.2GHz; rather it is definitely being scaled down to 1.2GHz and /proc/cpuinfo is wrong. – Mark Wagner Jul 9 '15 at 17:35
  • Since bios_limit is 2201000 setting /sys/module/processor/parameters/ignore_ppc to 1 probably won't help but you might try that. – Mark Wagner Jul 9 '15 at 17:39
5

BIOS changes are the best way to guarantee peak performance but some hardware controlled frequency scaling is inevitable(thermal throttling).

Here is a post from Intel about setting CPU Frequency. To a certain extent the CPU frequency can be controlled at the user and OS level. Here is some additional info from Arch Linux about frequency scaling that you might find valuable.

On the BIOS side a mass BIOS update of a group of servers could possibly be performed using an independent management interface such as a dedicated Intelligent Platform Management Interface(IPMI) NIC or a scriptable KVM system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.