Saturday, October 3, 2009

thermal handler : protect your computer from overheat

So recently i started encoding some of the videos i had from dvds into compressed formats as the dvds are getting scratched and damaged. So i used the avidemux program for it. However my laptop gets overheated a lot during high cpu usage.
Other problems with overheating came when i had to run my dsmc and other assignments. Since they run for a looong time, my laptop overheats and i used to keep it hanging on its side during overnight runs. To my horror once when i compiled openfoam on my laptop overnight, i saw it shutdown in the morning with a failed compile and overheat. So here's my solution for all those who suffer from the problem of overheating computers (for linux users only).
Checkout the all new "thermal handler" from yours truly. The solution for all your computer overheat problems due to high cpu usage.
What it does:
Checks the temperature periodically and pauses processes using high cpu when a certain temperature is reached (default 90) and resumes them when the temperature falls below a certain value (default 65). None of your data crashes. The programs resume from the same state they were paused. No data loss. (Note that root processes cant be paused by the user)
What you need to do:
just run from a shell:

$ python thermal_handler.py [temp_lo [, temp_hi]]

Here's thermal handler at work:



Download it from here : http://home.iitb.ac.in/%7Epankajp/web/downloads/thermal_handler.py

EDIT: Thanks to Prashant Agrawal for reporting that the initial version didn't work on AMD cpus and helping me to test. I've updated the file to work on AMD cpus now. check it out

1 comment:

  1. This would also be useful to package as a service, to have it continually running in the background, with a log for what processes we paused, when, and for how long. The temp thresholds could be read from an /etc file.

    ReplyDelete