1

TLDR; I am an junior level Linux user. Are my Linux boxes down-clocking themselves? is that a thing? If so how to I find out?

I am working with a bunch of Debian Linux servers in a datacenter and we suspect that the CPUs are being "down-clocked" (not sure if this is the right term).

Some people are saying the CPUs are running hot and I might need to ask the staff at this datacenter to replace the thermal paste on the CPUs or something.

I want to write a script to go over all of my servers and see which ones are down-clocking them selves.

NOW I don't need help with the Ansible part. I am looking for what commands to run or logs to search to find out if my Linux boxes are down-clocking themselves.

Mexicoder
  • 121
  • AFAIK all modern CPUs will protect themselves from overheating. So if there is a problem with temperature it will most commonly be seen first as a lower performance. Individual CPU models have their own thresholds for throttling and then in the worst case halting altogeather. – Philip Couling Feb 25 '21 at 16:09
  • Some CPUs (viz. some Intel Atom CPU, min. frequency approx. 700 MHz) can be downclocked even to frequencies as low as 32 MHz. The machine was not overheating but it had come issues with motherboard. – jiwopene Feb 25 '21 at 16:15

3 Answers3

2

Use lscpu command to view current CPU frequency. Modern CPUs downclock themselves automatically when the load is lower. When the temperature is low enough and load high, the CPU can automatically overclock itself. If you want to adjust these settings, use tools like cpupower.

To view frequency information:

cpupower frequency-info

To set max/min frequency:

cpupower frequency-set -u 42MHz  # max
cpupower frequency-set -d 42MHz  # min

To set governor (algorithm that chooses frequency) to ondemand (see the list in frequency-info):

cpupower frequency-set -g ondemand

Other cause of downclocking is overheating. CPUs are being automatically downclocked if their temperature is too high.

Use this command to view all temperatures in the system:

head /sys/class/thermal/thermal_zone*/temp /sys/class/hwmon/hwmon*/temp*_input

It usually reports temperatures in thousandths of °C.

jiwopene
  • 1,071
0

Modern desktop OSes including Windows, MacOS and Linux (not sure if OpenBSD/NetBSD/FreeBSD are set up the same way by default) downclock your CPU cores automatically to conserve energy.

If you don't want this behavior switch the CPU frequency governor to performance which will keep the CPU at the highest performance state, e.g.

echo performance | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_governor

This will unlikely to make your servers run faster but will definitely increase power bills.

0

I am working with a bunch of Debian Linux servers

sorry :)

Are my Linux boxes down-clocking themselves? is that a thing? If so how to I find out?

see What is the correct way to view your CPU speed on Linux?

I prefer watch -n.1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""

I use RHEL/CentOS and they have tuned-adm to set power profiles. Such that the default is the profile Balanced. There are many, such as Powersave, and I set my servers to latency-performance. If tuned is available for debian they my suggestion would be to use that, or whatever the equivalent of it is.

And a cat /proc/cpuinfo will tell you the make & model of your cpu then you can look that up online to verify it's actual base operating frequency and turbo frequency to know what to expect to see from that real time watch.

Going back and forth setting the profile in real time by doing tuned-adm profile latency-performance and tuned-adm profile powersave you can observe the watch command for all cores go from a solid 3.2ghz to 800mhz for example. So yes downclocking is a thing and the default power profile in debian is probably something like balanced it is likely not a power profile that is highperformance use as much power as possible at all times.

Some people are saying the CPUs are running hot and I might need to ask the staff at this datacenter to replace the thermal paste on the CPUs or something.

There seems to be a little contradiction in your wording... if the cpu frequencies were downclocked a.k.a. throttled or limited by some software means then they would be less likely to run hot. However realize that even if you did a power profile of powersave such that if all cores were at 800mhz at idle not in use then yes that will save power and heat a little bit but becomes a mute point when any user actively runs some code that puts the cpu (cores) to use then you will be generating the same amount of heat regardless of the power profile used.

my recommendation would be to look at or have purchased and installed a PDU that has a watt meter on it so you can observe the power draw of said server(s). Because it is power draw (in watts or kilowatts) that is directly corresponds to heat output (and user load) on a server. As well as monitor users and all software being run on the server(s). If someone does something dumb like relaunch an antivirus scan that never quits that will just load up cpu cores and cause heat (regardless of the power profile).

ron
  • 6,575