Is there a way to limit overall CPU consumption?
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.
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.
You can limit your CPU cores automatically based on temperature using the script temp_throttle. It can run in the background while you focus on more important things. An example on how to run:
sudo ./temp_throttle.sh 80 # Will limit CPU cores when 80C is reached.
*Disclaimer- I am the author and maintainer of temp_throttle*