V7 Folding on a ramdisk

Spazturtle

[H]ard|Gawd
Joined
Jan 4, 2013
Messages
1,526
If you use the v6 client then click here for Musky's guide: http://hardforum.com/showthread.php?t=1751872
This guide was made for v7 of the folding@home software running on debian or a debian based distro.

Folding on a ramdisk
ALL AS ROOT

Make the ramdisk
Code:
mkdir -p /mnt/ramdisk
mount -t ramfs -o size=4000m ramfs /mnt/ramdisk
mkdir /mnt/ramdisk/work
4000m is the size of the ramdisk

Now lets add that to rc.local
Code:
nano /etc/rc.local

Now add those 3 lines to the start of rc.local
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

mkdir -p /mnt/ramdisk
mount -t ramfs -o size=4000m ramfs /mnt/ramdisk
mkdir /mnt/ramdisk/work

exit 0

The ramdisk will now be created at boot.

Backing up the ramdisk
Code:
cd /var/lib/fahclient
mkdir work-backup
crontab -e
We are now taken to the cron editor.

Add this line to the bottom
Code:
0/15 * * * * cp -R /mnt/ramdisk/work/* /var/lib/fahclient/work-backup
this will copy /mnt/ramdisk/work/ to /var/lib/fahclient/work-backup every 15 minuites.


Making FAH run on the ramdisk

First
Code:
cd /var/lib/fahclient
service FAHClient stop
mv work/* /mnt/ramdisk/work
rm -rf work
chmod -R 777 /mnt/ramdisk

Now the work is on the ramdisk
DO NOT REBOOT AT THIS POINT!!!

time to symlink

Code:
ln -s /mnt/ramdisk/work work
and bam to test if it works type cd work

time to make the restore script
Code:
nano /etc/rc.local

Add the following 2 lines
Code:
cp -R /var/lib/fahclient/work-backup/* /mnt/ramdisk/work
chmod -R 777 /mnt/ramdisk

you rc.local should now look like this
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error. 
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

mkdir -p /mnt/ramdisk
mount -t ramfs -o size=4000m ramfs /mnt/ramdisk
mkdir /mnt/ramdisk/work

cp -R /var/lib/fahclient/work-backup/* /mnt/ramdisk/work
chmod -R 777 /mnt/ramdisk

exit 0

and you should be done.

Taken from my guide on my teams forum|
 
This was very helpful, dropped my write times at the end of WUs from 10 minutes to almost nothing. One question, though: does this mess with the service starting at boot? I had to reboot my machine, and after about 40 minutes it still hadn't started, forcing me to start the service manually. Before setting this up I did not have this problem. I believe I followed the guide to the letter, but I may have missed something.
 
if that happens again instead of starting it manually go to the folder with FAHClient in it and use ./FAHClient log
and see what it outputs.
 
You sure that's the correct syntax? When I enter that in /use/bin, where FAHClient is located, I get

ERROR:Exception: Failed to open 'log': Failed to open 'log': No such file or directory: No such file or directory

Here's the contents of the log file in /var/lib/fahclient after reboot:

Code:
*********************** Log Started 2013-04-16T01:14:21Z ***********************
01:14:21:************************* Folding@home Client *************************
01:14:21:    Website: http://folding.stanford.edu/
01:14:21:  Copyright: (c) 2009-2013 Stanford University
01:14:21:     Author: Joseph Coffland <[email protected]>
01:14:21:       Args: --child --lifeline 2082 /etc/fahclient/config.xml --run-as
01:14:21:             fahclient --pid-file=/var/run/fahclient.pid --daemon
01:14:21:     Config: /etc/fahclient/config.xml
01:14:21:******************************** Build ********************************
01:14:21:    Version: 7.3.6
01:14:21:       Date: Feb 18 2013
01:14:21:       Time: 07:24:08
01:14:21:    SVN Rev: 3923
01:14:21:     Branch: fah/trunk/client
01:14:21:   Compiler: GNU 4.4.7
01:14:21:    Options: -std=gnu++98 -O3 -funroll-loops -mfpmath=sse -ffast-math
01:14:21:             -fno-unsafe-math-optimizations -msse2
01:14:21:   Platform: linux2 3.2.0-1-amd64
01:14:21:       Bits: 64
01:14:21:       Mode: Release
01:14:21:******************************* System ********************************
01:14:21:        CPU: Genuine Intel(R) CPU @ 2.70GHz
01:14:21:     CPU ID: GenuineIntel Family 6 Model 45 Stepping 5
01:14:21:       CPUs: 64
01:14:21:     Memory: 62.89GiB
01:14:21:Free Memory: 61.92GiB
01:14:21:    Threads: POSIX_THREADS
01:14:21:Has Battery: false
01:14:21: On Battery: false
01:14:21: UTC offset: -7
01:14:21:        PID: 2139
01:14:21:        CWD: /var/lib/fahclient
01:14:21:         OS: Linux 3.5.0-27-generic x86_64
01:14:21:    OS Arch: AMD64
01:14:21:       GPUs: 1
01:14:21:      GPU 0: NVIDIA:1 GT218 [GeForce 210]
01:14:21:       CUDA: Not detected
01:14:21:***********************************************************************
01:14:21:<config>
01:14:21:  <!-- Client Control -->
01:14:21:  <fold-anon v='true'/>
01:14:21:
01:14:21:  <!-- Folding Slot Configuration -->
01:14:21:  <power v='full'/>
01:14:21:
01:14:21:  <!-- Network -->
01:14:21:  <proxy v=':8080'/>
01:14:21:
01:14:21:  <!-- Remote Command Server -->
01:14:21:  <password v='******'/>
01:14:21:
01:14:21:  <!-- User Information -->
01:14:21:  <passkey v='********************************'/>
01:14:21:  <team v='111065'/>
01:14:21:  <user v='Zagen30'/>
01:14:21:
01:14:21:  <!-- Folding Slots -->
01:14:21:  <slot id='0' type='CPU'>
01:14:21:    <client-type v='bigadv'/>
01:14:21:    <cpus v='64'/>
01:14:21:    <max-packet-size v='big'/>
01:14:21:    <next-unit-percentage v='100'/>
01:14:21:  </slot>
01:14:21:</config>
01:14:21:Switching to user fahclient
01:14:21:Trying to access database...
01:14:21:ERROR:Exception: Failed to create directory './work': boost::filesystem::create_directory: File exists: "./work"
 
Back
Top