[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to limit a CPU temperature?




On 08/04/2023 15:17, songbird wrote:
  i have a program that has changed it's behavior to suddenly
become a CPU hog (while doing something simple like uploading
files for my website).  probably a bug, but it got me to 
wondering how i could limit the CPU temperature to a range 
well below the maximum that kicks in by the CPU itself.

  i have an intel processor and it has the MAX which does
prevent it from going higher (100C), but i'd like to keep it
at 70C or lower.

  i've been trying to find anything that will let me set this
but no luck yet in my searches.

You might try combining your queries with terms for various CPU-intensive activities such as BOINC, Folding@Home or Bitcoin mining. I'm not suggesting your task is related to any of these, but the people who do use these programs face similar issues.

For example, there is the TThrottle program for windows which will pause BOINC calculations when the CPU temperature goes too high. I don't believe that's available for linux, though.

As an alternative, you could try writing a small shell script that works like the following (pseudocode):

 STOP_TEMP=70
 START_TEMP=65
 JOB_RUNNING=1

 while true:
   cpu_temp=$(cat /sys/something/temperature)

   if JOB_RUNNING and cpu_temp > STOP_TEMP:
     systemctl stop something.service
     JOB_RUNNING=0
   elif not JOB_RUNNING and cpu_temp < START_TEMP:
     systemctl start something.service
     JOB_RUNNING=1
   endif

   sleep 1
wend



  thanks!  :)


  songbird

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: