1

I want my server with debian 8.1 not to use cpu scaling but always run at the highest possible frequency.

I have installed cpufrequtils

$ dpkg -l | grep cpufreq
ii  cpufrequtils                   008-1                       amd64        ...
ii  libcpufreq0                    008-1                       amd64        ...

I set the governor to performance with

$ cat /etc/default/cpufrequtils 

ENABLE="true"
GOVERNOR="performance"
MAX_SPEED="0"
MIN_SPEED="0"

and called /etc/init.d/cpurequtils restart

When I list my cpu info with cpufreq-info I get results like this:

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: 0.97 ms.
  hardware limits: 1.20 GHz - 3.80 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 1.20 GHz and 3.80 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 1.73 GHz (asserted by call to hardware).

The last line shows that the cpu is not running at full speed. When I check the values from /sys I get the same results:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
echo "--"
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq

1198203
1199707
2001015
3048828
1551210
1358847
2953808
1982832
1523867
1200253
1654296
3446132
--
1198203
1199707
2001015
2643730
1772695
1358847
2953808
1982832
1523867
1200253
1654296
3446132

What I wonder about is that I do not have any file named 'scaling_available_frequencies' in /sys which is mentioned in many howtos

ls -1 /sys/devices/system/cpu/cpu0/cpufreq/
affected_cpus
cpuinfo_cur_freq
cpuinfo_max_freq
cpuinfo_min_freq
cpuinfo_transition_latency
related_cpus
scaling_available_governors
scaling_cur_freq
scaling_driver
scaling_governor
scaling_max_freq
scaling_min_freq
scaling_setspeed

The appropiate kernel modules are all loaded:

$ lsmod | grep cpufre
cpufreq_powersave      12454  0 
cpufreq_userspace      12525  0 
cpufreq_conservative    14184  0 
cpufreq_stats          12782  0 

Now I set scaling_min like this:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

Now I get Infos like sees, which say frequency should be between 3.80 GHz and 3.80 GHz but actually is not:

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: 0.97 ms.
  hardware limits: 1.20 GHz - 3.80 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.80 GHz and 3.80 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 2.84 GHz (asserted by call to hardware).

The governor "performance" doesn't seem to do the job. So how to I force my CPUs to run at full speed?

1
  • 1
    How about disabling these features in BIOS? (C-States or similar)
    – Lenniey
    Jul 29, 2015 at 7:08

2 Answers 2

2

You had to check your BIOS, because the CPU P-states seems to be only partly recognized. If found that many server BIOS (mainly DELL) are really broken when dealing with power saving.

So, enter in your BIOS and disable any CPU powersaving features. The only ones I suggest you to leave enabled are the one regarding C states (es: C1E, C6/E, ecc.). If your BIOS let you select a power profile, select "Max performance".

1
  • I don't like manipulating the BIOS and as I read more about p states it seems to me that I can't do anything and accept the "performance" state still varies in frequencies. But I guess the CPU knows better what and when to do. But thanks for your answer as I learned a lot from it about p-states
    – Janning
    Jul 30, 2015 at 14:47
0

3.8Ghz sounds like a turbo-boost frequency. You can't run all the cores at that speed all the time - the CPU won't allow it (it'd go over its power budget). Your CPU is probably running as fast as it can go.

In newer kernels the governor just tells the CPU what to prioritize - performance or power-savings - and lets it try to get the best result possible depending on activity. It's in a far better position to do it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .