temp-throttle
temp-throttle copied to clipboard
A new refactored tempthrottle
Because my mini-PC greatly suffers during summer days, especially when running a Zoom conference, I stumbled upon tempthrottle and used it as an emergency escape, thanks!
Shortly after, I realised that this is not exactly what I would need, and I started modifying it. In the end, I turned out to have completely rewritten it, apart from a few lines. I have temporarily put the result (which I am using on two different computers) under https://fly.isti.cnr.it/pub/software/unix/tempthrottle2
Now I am undecided what to do. One possibility is to have this become the next version of tempthrottle, but this is up to Sepero to decide. Another one would be to set up my own repository and call this tempthrottle2 or the like. What do Sepero and other people think?
Very neat. I've quickly looked over your code, and there are some things I like. I'm curious, what about my code did not suit your desires?
I never included a minimum temperature in my code because if the system is fully unthrottled, then doesn't ever seem to make sense to force a system to become hotter.
I have a mini-PC at home. It used to run cool when I bought it, but I had underestimated how much increasing the memory from 4 to 24 GB and the nvme from 128 to 1024 GB would have changed its thermal footprint. Now it runs hot and loud, which I do not like. With the summer came a more serious problem: the box becomes really too hot when using Zoom, to the point that it briefly freezes during video conf, because of the packages temperature reaching at times 100°. I tried thermald, but for some reason it does not work (it does work on my box at the office). So I tried tempthrottle, which worked. But.
Tempthrottle 80 waits for the temperature to reach 75° to intervene. At this point it is too late, the box is fully hot, and it takes a lot to cool down. On my i7 Tempthrottle brings the frequency from 2300 to 400 kHz in 100 kHz steps, one step every 3s, which means 60s. In the meantime, the temperature keeps increasing. And going 20 steps makes little sense in my case and, I think, in general: if I call it with a 60 argument, the temperature will hover around 60° with an essentially on-off behaviour. Once it starts descending, it goes straight to the bottom, and the opposite is true when increasing, the thermal inertia is too big for anything to change in a 60s time frame. In fact, there is no graduality and keeps working in on-off mode. If I change the range width from 5° to, say 25° it does more or less the right thing, but often too slowly because of the high granularity which slows everything down.
So the main improvement was to reduce the granularity to few steps (the exact number is computed depending on the temperature range). The second was to start reducing the max requency sooner (25° by default rather than 5°). This way, instead of a permanent on-off behaviour, stability is usually reached quite soon and maintained with time for a given load, thanks also to the 3° hysteresis.
As far as I can tell, defaults are sane and should work reasonably well with all machines which need reduced power consumption because of temperature or battery exhaustion issues.
Now I can have zoom meetings and night backups without overheating. During the zoom meetings the max frequency goes down to 400 kHz, which makes the box generally sluggish, but that does not affect zoom, I guess because it mostly relies on the graphics card.
So you increased storage and memory by a factor of 6, but didn't increase the cooling. It isn't very surprising that it runs much hotter. You could always try permanently under-clocking your CPU to reduce the heat generation.
Yes, nothing to be surprised, after the fact :)
I have had experience with full-size and mid-sized cases, where my problems were cooling the cpu and possibly the gpu while keeping the noise low. I always had systems which I wanted to be silent, not max performance, and I never had any problems with memory or disks.
This is a NUC8i5BEH2 (not i7 as a previously wrote, sorry), and in fact it could be expanded to 32 GB. Now, if I buy something that can be expanded and when you expand it you cannot use Zoom on it, that means the box is not well designed. Moreover, the latest bios upgrade disabled the possibility of undervolting, so something like tempthrottle is my only way to go, and in fact it works.
However, apart from my special case, I think the changes I made are a general improvement.
I like your modifications and what you've done, and so I have a proposal.
- Think of a New name for your code. Some suggestions: cpu-boss or temp-master-pro or thermal-king or whatever your imagination.
- We will link to each other's code, and help promote each other in search rankings.
- People will have the option to easily choose between either of our projects, your newer code and my older code. Then they can decide which suits them better.
- Whatever works for people is great. It's all GNU and we all win.
This is godspeed script. I used it for my Nexus 7 2012 grouper on pmOS kernel 6.0.6. It run so fast, even faster than Android 7.1.2. I'm so excited.
Using max scaling frequecy at low temperature, and throttle with temp range < max temp. That's why he need min temp
Thanks @fpoto
Sorry for not creating a new project. My free time comes and goes. I still have plans to follow @Sepero's suggestion, but I have not time plan for it :(