After months of trying to learn out how, I’ve finally mastered the cpulimit library for linux! I learned about it many months ago while looking at add-ons for the “http://boinc.berkeley.edu/”:BOINC distributed computing project. You see, I needed a way to limit the amount of CPU power that BOINC used when it ran its computations — this is mainly so I can run it at work!
My computer at work is a fairly modern Intel system, so it has all sorts of fans and magic-step-up temperature controls and whatnot, and everytime I start doing anything even _remotely_ CPU-intensive, this case fan at the front of my desktop starts spinning faster, and faster, and faster, until it sounds like there’s a jet engine inside my cubicle!
Well, this just certainly won’t do. I’d love to use the idle computing power of my work PC (which is just being absolutely _wasted_ by me doing nothing but programming on it), but I can’t have somebody eventually getting suspicious because of the racket coming from my PC.
In steps the cpulimiter library. This handy dandy little _whatever_ (”process,” I guess) will only allow a process to use a limited amount of CPU power from within linux (did I mention I’m doing all of this inside of a virtual machine?). It wasn’t included with the “http://www.ubuntu.com”:Ubuntu 6.06 virtual machine I use at work, so I actually had to download the source and compile it myself! Yay! You betcha — it didn’t work at all!
The virtual machine version of Ubuntu was missing the _make_ compiler, not to mention the necessary C and C++ libraries necessary to do the compiliation. I managed to get the stuff I needed after just randomly downloading important looking libraries from the Synaptic Package Manager, and eventually got it compiled!
Now, I’m free to run BOINC on my work PC (which is actually pretty damn fast) whenever I choose. The Intel chip in my PC runs pretty damn hot no matter what (idle temperature is around 55° C!), but at least it’s not noisy.


2 comments ↓
Well, ain’t that handy.
das ist handy, jah!
Leave a Comment