Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
CPU temp reporting
« previous
next »
Print
Pages: [
1
]
Author
Topic: CPU temp reporting (Read 3142 times)
Dimi3
Jr. Member
Posts: 51
Karma: 2
CPU temp reporting
«
on:
October 01, 2023, 09:39:00 am »
Hello,
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, I got more realistic CPU temp with command;
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
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.
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 tested this on my other firewall running Intel core I5 and there the difference is max 2-3 degrees Celsius, that its not really noticeable.
I also searched the forum, and few similar post have already been posted;
https://forum.opnsense.org/index.php?topic=34395.msg166556#msg166556
I think that it would be good to revise the temp monitoring and maybe use sysctl dev.cpu | grep temperature as it reports more "real" CPU temp.
Regards,
Logged
vicking
Newbie
Posts: 19
Karma: 0
Re: CPU temp reporting
«
Reply #1 on:
September 19, 2024, 11:53:40 am »
Bumping this old thread because I see the same behavior!
Logged
rickyricky
Newbie
Posts: 2
Karma: 0
Re: CPU temp reporting
«
Reply #2 on:
November 24, 2024, 10:48:46 pm »
you're querying the same values, but one method parses MUCH less data than the other...
Here is the dev.cpu method...
```
root@router-02:~ # sysctl dev.cpu | wc -l
273
```
Looking for temp by looking at only needs to export and grep through 273 lines.
Here is the sysctl -a method...
```
root@router-02:~ # sysctl -a | wc -l
16497
```
The sysctl has to export 16000+ more lines than the one that only looks at cpu values, then has to grep through those 16k values to find the ones that match the grep.
The 2nd command finishes quickly, but it still causes enough additional cpu load to show the temp has been raised by the time temperature is filtered out by the grep command.
Logged
_tribal_
Newbie
Posts: 33
Karma: 1
Re: CPU temp reporting
«
Reply #3 on:
November 26, 2024, 11:10:49 am »
Are you saying that a simple grep execution on of only 16k records gives a CPU load high enough to raise the temperature of a not so weak CPU by +10 degrees? Really?
Logged
meyergru
Hero Member
Posts: 1710
Karma: 167
IT Aficionado
Re: CPU temp reporting
«
Reply #4 on:
November 26, 2024, 12:05:18 pm »
Yes, it does. By reducing the output to a few lines, the CPU footprint can be reduced.
See:
https://github.com/opnsense/core/pull/8090
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
_tribal_
Newbie
Posts: 33
Karma: 1
Re: CPU temp reporting
«
Reply #5 on:
November 26, 2024, 07:28:36 pm »
But the patch wasn't accepted. Your commit is closed without merging with the main code branch.
Logged
meyergru
Hero Member
Posts: 1710
Karma: 167
IT Aficionado
Re: CPU temp reporting
«
Reply #6 on:
November 26, 2024, 07:32:08 pm »
I know. That is because you cannot limit the sysctl output without risking to skip temperature sensors that lie outside of dev.cpu and hw.acpi subtrees.
It is what it is, I tried... :-(
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
_tribal_
Newbie
Posts: 33
Karma: 1
Re: CPU temp reporting
«
Reply #7 on:
November 26, 2024, 10:02:50 pm »
Can you make an installable patch with these changes? On my platform there are no such sensors and I am able to sacrifice unnecessary code for a proper display of the temperature and not as it is now +10..+12 degrees.
Logged
meyergru
Hero Member
Posts: 1710
Karma: 167
IT Aficionado
Re: CPU temp reporting
«
Reply #8 on:
November 26, 2024, 10:08:47 pm »
It is just one changed line in /usr/local/opnsense/scripts/system/temperature.sh like so:
https://github.com/opnsense/core/pull/8090/commits/de7e48ab1e1c339fdae78eaf95b54b09d6e1ac44
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
CPU temp reporting