My laptop (an HP with an i3 chip) overheats like crazy every time I run a resource heavy process (like a large compilation, extracting large tarballs or ... playing Flash).

I am currently looking into some cooling solutions but got the idea of limiting global CPU consumption. I figured that if the CPU is capped, chances are the temperature will stop increasing frantically, and I'm willing to sacrifice a little performance in order to get the job done.

6 Answers
6

I don't know that limiting CPU to the whole system is something that's possible without a lot of hacking, but you can easily limit the amount of CPU used by a single process using cpulimit

The only way I can think of you being able to use this effectively is writing a wrapper script (can't really call it a script, it's so small) for the applications which you know are resource hogs. Say for example, you find google-chrome uses a lot of CPU, you could replace the google-chrome binary in your path with something like:

#! /bin/bash
cpulimit --limit 70 /usr/bin/google-chrome-bin

I haven't tested this so take it with a grain of salt. From cpulimit's website, it seems like you might be able to set rules for cpu limits on different applications. I'm not sure, you'd have to take a look.

Another alternative that hasn't been mentioned is cpufrequtils, which I have installed and used on my laptop with Debian 6. It allows you to change the algorithm (governor, in cpufrequtils terminology) that the kernel uses to scale the clock rate up and down in response to load - in particular, the userspace governor allows you to lock the frequency at something of your choosing (of course the CPU needs to be capable of running at this speed).

I've used it to lock an Atom at 800MHz instead of 1.6GHz, for example. It's very easy to use.

Only a additional note to the answer: renice, nice or other similar tools will not effect in the temperature of the CPU, the problematic process will continue eating the CPU cycles.
–
J.F.Aug 23 '11 at 2:35

2

Nice and renice won't cap the CPU consumption. They simply set priorities. If nothing else is running at the same time, process will still consume all the processing power.
–
rahmuAug 24 '11 at 9:09