Skip to content

CPU temperature reporting in dashboard #6911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dimitrijp opened this issue Oct 4, 2023 · 5 comments
Closed

CPU temperature reporting in dashboard #6911

dimitrijp opened this issue Oct 4, 2023 · 5 comments
Labels
help wanted Contributor missing / timeout support Community support

Comments

@dimitrijp
Copy link

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Im testing new Intel N200 box, and came across interesting issue with CPU temperature reporting. My fanless box is practically cool to touch, but CPU temp in OPNSense is reporting 45 degrees, that it seemd to me too much. So I did some digging.

If I log in console and issue sysctl dev.cpu | grep temperature, I got more realistic CPU temp

sysctl dev.cpu | grep temperature
dev.cpu.3.temperature: 35.0C
dev.cpu.2.temperature: 35.0C
dev.cpu.1.temperature: 36.0C
dev.cpu.0.temperature: 35.0C

I checked what command is OPNSense using for temp sensors and its sysctl -a | grep temperature, this temp is also reported in dashboard.

sysctl -a | grep temperature
hw.acpi.thermal.tz0.temperature: 27.9C
dev.cpu.3.temperature: 45.0C
dev.cpu.2.temperature: 45.0C
dev.cpu.1.temperature: 44.0C
dev.cpu.0.temperature: 43.0C

If I stress test the machine this 2 temps come together at 55 degrees after 30 min witch is ok.

I installed HTOP and check the temp there, the lower values are reported, with occasional spike above 40 but average at 36 - 37 degrees.

I live booted linux on the same machine and checked linux temp sensors .. they are also reporting average of 36 - 38 degrees.

Out of curiosity I also spin up pfsense, and temp was also ok .. no spikes above 40 degrees. - but pfsense is using different command to read cpu temp then opnsense, I think sysctl dev.cpu | grep temperature

Overall this is not life threatening situation 😊 😊, but only my observation I decided to post it here. According to my testing both temps are correct higher temp is actually achieved by CPU when short load hits it, but it lasts less then a second and it falls to 36 degrees. It looks to me that the command sysctl -a | grep temperature is displaying max values in certain period, averaging in higher temp in dashboard that it really is.

I also searched the forum, and few similar post have already been posted;

https://forum.opnsense.org/index.php?topic=34395.msg166556#msg166556

Maybee you could revise the temp monitoring and maybe use sysctl dev.cpu | grep temperature, if it reports more "real" CPU temp, or maybee I'm missing something obvious here...I also dont understand why 2 different commands output up to 10 degree difference.

A clear and concise description of what the bug is, including last known working version (if any).

Tip: to validate your setup was working with the previous version, use opnsense-revert (https://docs.opnsense.org/manual/opnsense_tools.html#opnsense-revert)

To Reproduce

Steps to reproduce the behavior:
sysctl dev.cpu | grep temperature
sysctl -a | grep temperature
observe the difference
Compare dashboard temp with htop temp in console

Expected behavior

Real temperature of CPU cores

Describe alternatives you considered

None

Screenshots

If applicable, add screenshots to help explain your problem.

Relevant log files

If applicable, information from log files supporting your claim.

Additional context

Add any other context about the problem here.

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 19.1.1 (amd64, OpenSSL).
Intel® Xeon™ E3-1225V5 3.3Ghz Quad Core
Network Intel® I210-AT

@AdSchellevis
Copy link
Member

isn't the attribute dev.cpu.3.temperature: 35.0C the same as dev.cpu.3.temperature: 45.0C? both sysctl commands should read the same thing, maybe it fluctuates a lot?

The dashboard executes configctl system temp, what does that show?

@dimitrijp
Copy link
Author

Yes the commands should read the same atributes, this is why is confusing to me :), HW is ok, box is mostly idle since its just sits with default install, no peaking loads on the CPU

issued both commands inside 1 sec window;

root@OPNsense:~ # configctl system temp
dev.cpu.0.temperature=46.0C
dev.cpu.1.temperature=46.0C
dev.cpu.2.temperature=46.0C
dev.cpu.3.temperature=46.0C
hw.acpi.thermal.tz0.temperature=27.9C

root@OPNsense:~ # sysctl dev.cpu | grep temperature
dev.cpu.3.temperature: 36.0C
dev.cpu.2.temperature: 35.0C
dev.cpu.1.temperature: 34.0C
dev.cpu.0.temperature: 35.0C

Issuing command sysctl dev.cpu | grep temperature* multiple times i can see that sometimes for half a second temperature spikes verry briefly, but mostly is at 35 - 36. Out of 20 displays in a row i see 1 spike over 40.

It looks that command sysctl -a| grep temperature* or configctl system temp just reads this spikes or max values and reports them, although attribute is the same.

@AdSchellevis
Copy link
Member

The execution might just influence the reading, both sets of information are the same, but reading all sysctl values takes more cycles. Likely not much we can do about that, could be very hardware specific as well.

@fichtner fichtner added the support Community support label Oct 10, 2023
@doktornotor
Copy link
Contributor

I would hazard to say having the ever-refreshing dashboard displayed causes tons more system load in itself. sysctl -a or sysctl dev.cpu won't make any difference.

@OPNsense-bot
Copy link

This issue has been automatically timed-out (after 180 days of inactivity).

For more information about the policies for this repository,
please read https://github.com/opnsense/core/blob/master/CONTRIBUTING.md for further details.

If someone wants to step up and work on this issue,
just let us know, so we can reopen the issue and assign an owner to it.

@OPNsense-bot OPNsense-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2024
@OPNsense-bot OPNsense-bot added the help wanted Contributor missing / timeout label Apr 1, 2024
stuart-mclaren added a commit to stuart-mclaren/core that referenced this issue Aug 11, 2024
There can be a mis-match between the CPU temperature
reported by the operating system and the CPU temperature
shown in the OPNsense dashboard.

This happens for N100, N200 and possibly other CPU types.

The issue seems to be that the sysctl -a command (which
returns around 14,000 lines of output) causes a short-lived
spike in CPU temperature. This spike causes an elevated
temperatue value to be reported in the dashboard.

Avoiding "sysctl -a" means that the dashboard temperature
matches the OS reported temperature.

Current script:

 # /usr/local/opnsense/scripts/system/temperature.sh
 dev.cpu.0.temperature=46.0C
 .
 .
 .

With this change:

 # ./temperature.sh
 dev.cpu.0.temperature=40.0C
 .
 .
 .

This issue was previously reported here:
 opnsense#6911
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributor missing / timeout support Community support
Development

No branches or pull requests

5 participants