Wednesday, April 13, 2016

linux - cpufreq-info differs from /proc/cpuinfo?

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

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...