I am attempting to do some data science with CPU core temperatures. I need to monitor how CPU core temperature changes over time. I am attempting to use two tools to do this:
- lm-sensors for measuring core and package temperature
- stress for generating a load
The problem I am seeing is that as soon as stress starts the temperature skyrockets, and as soon as it stops it plummets. This can't be right!
Here is a little shell script and output to demonstrate the problem:
Script:
sensors | grep Core
stress -c 8 -t 1
sensors | grep Core
str=$'Sleeping for 1s \n'
read -t 1 -p "$str"
sensors | grep Core
Output:
Core 0: +49.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +51.0°C (high = +100.0°C, crit = +100.0°C)
Core 2: +49.0°C (high = +100.0°C, crit = +100.0°C)
Core 3: +47.0°C (high = +100.0°C, crit = +100.0°C)
stress: info: [6956] dispatching hogs: 8 cpu, 0 io, 0 vm, 0 hdd
stress: info: [6956] successful run completed in 1s
Core 0: +81.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +73.0°C (high = +100.0°C, crit = +100.0°C)
Core 2: +73.0°C (high = +100.0°C, crit = +100.0°C)
Core 3: +68.0°C (high = +100.0°C, crit = +100.0°C)
Sleeping for 1s
Core 0: +51.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +53.0°C (high = +100.0°C, crit = +100.0°C)
Core 2: +51.0°C (high = +100.0°C, crit = +100.0°C)
Core 3: +48.0°C (high = +100.0°C, crit = +100.0°C)
+51.0°C (high = +100.0°C, crit = +100.0°C)
Is this expected behavior? Is it physically possible for the temperatures sensors to see that much change this quickly? If so, I'm in trouble in terms of characterizing temperature changes. There is no time for me to gather data. The temperature basically spikes instantaneously, doesn't change while the jobs are running, and the vanishes as soon as the job finishes.
I ran the same experiment on an RPi and it took the fully loaded quad core about 60 seconds before frequency scaling set in, so I have no idea whats happening now that I am trying to bring the project to a more complex architecture.
This is on an Intel Core i7 Skylake architecture. Any help understanding this would be greatly appreciated.