If you linked here directly, feel free to go back and read part 1 for background on this project, located here. If you’re still with us from Part 1, Thanks!
Recently, I filled a 4 foot rolling rack with equipment. A 4 core IBM eSeries server with 2 TB of SCSI storage running ESXi is one of the main components. I always like to keep the server online for various sundry items, but it usually sits largely idle, even with two Red Hat Linux instances running on it while I am studying. This is somewhat of a waste in my opinion because the server is sitting idle with spinning fans while not doing much of anything. A wonderful solution to this is have ESXi run a guest, specifically for the folding application. If set up correctly, you can even have ESXi dedicate as much of the machine’s resources for CPU and memory as possible during downtime, and have it throttle it back when other applications are working on mission critical things. I’m looking at you, small business and enterprise owners.
Most people download and install Ubuntu, or Windows as their OS choice for Folding@Home. Since these OS’s are geared more toward the Desktop user, they have a little too much overhead for my liking when picking something for one process (yes, I just said that). My OS of choice for this process was CentOS 5.5, but that’s just personal preference. I aimed to install a minimally loaded, no frills OS with bare minimum internet connectivity and libraries required to make Folding@Home run, but it can happily share any Linux box you’ve got. My base installation, along with a few programming libraries and a webserver, took about 2.5 gigs (keep in mind that a lot of this was the swap file I allocated during install, you may choose an amount that is drastically lower). If you aren’t familiar with the Linux command line, you’re going to want to install the GUI, but I’m right at home there, so I opted to save space.
It’s then a simple matter of downloading and installing their client onto your machine, here’s the blow by blow:
(Note: Be sure to find the correct version by checking http://folding.stanford.edu/English/Download)
Once you’ve determined your version, find a suitable install target, download and install by unarchiving…
Make the directory. Go to it.
ewolf@folding$ mkdir folding; cd folding/
This command downloads the package from Stanford, substitute the link to your install here.
ewolf@folding$ wget http://www.stanford.edu/group/pandegroup/folding/release/FAH6.29-Linux.tgz
Uncompress and unarchive the install.
ewolf@folding$ tar -xzvf FAH6.29-Linux.tgz
This will leave you with 2 files.
Give the binary execute permissions.
ewolf@folding$ chmod u+x fah6
Now, we have to configure the client settings by running the following command:
ewolf@folding$ ./fah6 -configonly
Follow the onscreen setup instructions. These are the same as the configuration pane on Windows, just in text form.
Next, make it easy on yourself. Build a start script for the startup command, give execute permissions:
ewolf@folding$ echo "./fah6 -verbosity 9 $*" > fah; chmod u+x fah
If this is a dedicated VM or machine, and you want this process to use all of your allocated processor power, this is the last step required for configuration. To run this script on demand, simply execute it:
This will bring up a super neato (Not) screen with status information on your fold workload.
(click for full size)
Now for the tweaks. There are two you may want to do right off the bat: CPU throttling and Automatic startup. Here’s what my VM performance looks like when running this with minimal configuration:
(Click for full size)
This may be a problem if you aren’t fond of running your CPU’s at full utilization, due to electricity costs, wear and tear/etc…. If that is the case for you, there is a 3rd party utility available (freeware) to get the cpu utilization throttled back called “fahlimit” (click here for website in new window). Run it as a part of your start/stop script I am going to cover shortly if this is a consideration.
<rant> Just as an aside, there’s a lot of talk on the Folding@Home website about how you should be able to run your processors at 100% all the time, without consequence (other than power consumed). I’m here to tell you that this is just NOT TRUE. Any amount of added heat, especially from processing wear and tear, will always cause your electronics to fail sooner than they would have if they had an average load on them. Heat is the absolute enemy of electronics. 100% CPU utilization all of the time causes LOTS of heat. The fact that the heat is dissipated with adequate heat sinking and fan cooling is immaterial. These measures only will prevent your CPU from absolute failure from overheating. </rant>
Here’s what I did to install fahlimit:
First, get into the install directory (substitute $FAH with your install directory path)
ewolf@folding$ cd $FAH/
ewolf@folding$ wget http://calxalot.net/downloads/versions/fahlimit/0.6/fahlimit-0.6-linux.tgz
Unarchive and uncompress fahlmit.
ewolf@folding$ tar -xzvf fahlimit-0.6-linux.tgz
Now run the extracted tool, also called fahlimit, with your desired utilization with this command:
ewolf@folding$ ./fahlimit -daemon -percent 50
As you can see, I’m using 50 percent here, and it’s brought my CPU utilization down accordingly:
(Click for full size)
Now that we’ve configured everything for optimum use within the OS, I will show you how to put it all together and autostart your folding when your VM comes up. Instead of explaining everything in the start/stop script, and pasting it here, I am offering it in a .txt file, viewable here.
I installed a copy in my installation directory, and soft linked it to /etc/init.d, but it will of course work just as well if you have a copy in both spots. Pay close attention and edit the script as necessary to suit your own installation needs. And also, don’t forget to give the start script execute permission:
chmod u+x folding
To get it to start with the server, we just register it with chkconfig (You will probably have to be root to move the file into /etc/init.d as well as register with chkconfig):
root@folding# chkconfig --add folding
And that’s all it takes. To verify it’s going to start, just query chkconfig to tell you which runlevels it will start with:
root@folding# chkconfig --list folding
You should see the word “on” after runlevels 3, 4, and 5. If this is not the case, please consult the man page for chkconfig for further assistance.
Next, continue on to part 3, where I will briefly show you how to set up ESXi to utilize this lovely purpose-driven VM during off hours and non-peak processing times……but first, I need some sleep. More to come in the next few days!