Limiting CPU of BOINC client automatically

Yesterday an article was on the front page of digg, regarding fighting climate change by leaving your computer turned on, and it piqued my interested (after all, your computer being turned on is wasting electricity, so how could it possible counter that horrible effect?), so I took a look and it was just an pseudo advertisement for participating in BOINC for climateprediction.net. Now, while I normally don’t participate in any distributed computing projects, simply because I hate having my server bring up room temperature by multiple degrees, I figured I’d give it a try for the pure challenge of trying to limit the CPU it uses.

So I did some due diligence and found an application for Linux called cpulimit, which lets you specify a process by name, PID or by full path, and this program will limit it to a certain amount of CPU utilization, so I can tell the BOINC client to only use 25% of my CPU, for example. Now, while cpulimit is a pretty neat application, it has one problem, and that is its inability to limit the CPU usage of child processes spawned from one of your existing limited process. This means that in the case of BOINC, I can’t just start it and then tell cpulimit to limit the boinc_client process, since that process kicks off any number of additional processes.

However, what you can do is write a script that will find all processes being run by your boinc user (I did an apt-get install boinc-client, and the Debian package automatically creates a boinc user and runs all of the processes as that user), and throttle them, then just toss that into cron and make sure that none of the processes use more than your specified limit.

Take a look “after the jump” for the bash script that does the above. It’s quite simple, but amazingly I couldn’t find any off-the-shelf ones on Google.

 (more...)

VMware ESX 3.5 on non-supported hardware

The list of supported hardware for VMware ESX 3.5 is about 5 devices long, which means that if you want to use local SATA for storage on a VMware server, and don’t feel like buying new servers, or doing some weird cross-NFS storage model with multiple gigabit ethernet links between the boxes, you have to hax0r ESX.

I found a really good thread on the VMware forums where a number of people are trying to get ESX 3.5 running on their unsupported SATA based devices and a lot of them are actually able to do it. I, on the other hand, am unsuccessful so far, but I’ll keep trying. Regardless, If you’re seeing the following after installing and booting up into ESX 3.5, head over to the forum and see if the scripts provided there can lend you a hand:

Mounting root failed. Dropping into basic maintenance shell.
To collect logs for VMware, connect a USB storage device and
run 'bin/vm-support <devicename>'.
Machine will be rebooted when you exit from this shell.

And make sure to post a comment if you get your unsupported SATA-based server working.

Update: One of the guys participating in the thread has created a list of unsupported SATA controllers and motherboards that are known to work with ESX 3.5, and the necessary hacks to get them working. I love the internets.