landscape-sysinfo reports exaggerated temperatures

Bug #1945219 reported by Harm van Bakel
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When running landscape-sysinfo the temperature that is reported is often exaggerated compared to other measurements taken by e.g. running 'sensors'. After some testing it seems that the temperatures that are reported are correctly read from the thermal_zone information; however, the act of running the landscape-sysinfo script inflates the measurement at the time it is taken. Likely this is because of an increased CPU load just prior to the measurement.

I imagine the impact of this issue will depend widely on the specific hardware that is used and the types of thermal zones reported. Nonetheless, I found that the impact of the issue can be greatly reduced by including a 50ms 'sleep' in the ThermalZone class just before reading the temperature value. For example, adding a "time.sleep(0.05)" before the line "self.temperature_value = int(line.strip()) / 1000.0" in /usr/lib/python3/dist-packages/landscape/lib/sysstats.py drops the reported temperature of an idle Intel(R) Xeon(R) CPU E3-1245 from 70C to a much more reasonable 48C, which is much closer to the temperature reported by e.g. 'sensors' (typically within 1 degree on 3 different platforms tested).

Adding a small wait time before the temperature reading will increase the run time of the script, but since the wait interval is so short it isn't noticeable. The only exception might be systems with a very large number of thermal zones (e.g. 10 zones would increase the total delay to 0.5 sec). Perhaps there are other more elegant ways to ensure that the temperature measurement is more accurate, such as changing the run order of the different sysinfo components to ensure the lowest CPU usage at the time temperatures are taken. Hopefully this can be integrated in a future release to have more realistic temperature reporting.

Revision history for this message
Don van der Haghen (avg-don) wrote :

We are running into the same issue, after adding a small delay of only 0.05 seconds the temperature shown will be +/- 20C lower. This is on Ubuntu 22.04.3 LTS.

root@hostname:~# landscape-sysinfo |grep Temperature
  Temperature: 59.0 C

But when I modify landscape-sysinfo from:
---------
if __name__ == "__main__":
    run(sys.argv[1:], reactor)
---------
To:
---------
if __name__ == "__main__":
    import time
    time.sleep(0.05)
    run(sys.argv[1:], reactor)
---------

The temperature shown will then be 21C lower:
root@hostname:~# landscape-sysinfo |grep Temperature
  Temperature: 38.0 C

The temperature shown will then be the same as the temperature shown by the sensors command:
root@hostname:~# sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +38.0°C (high = +100.0°C, crit = +100.0°C)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in landscape-client (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.