Answer: What is Distcc? Well, let them explain in their own words:
Distcc is a program to distribute compilation of C or C++ code across several
machines on a network. Distcc should always generate the same results as a local compile,
is simple to install and use, and is often two or more times faster than a local compile.
Distcc does not require all machines to share a filesystem, have synchronized clocks,
or to have the same libraries or header files installed. Machines can be running different
operating systems, as long as they have compatible binary formats or cross-compilers.
So let's say you have a smaller computer and it takes forever to compile with. You can help it out with Distcc. Heck, even your faster computers can use some help also. This isn't hard to setup and use. I'll supply some links at the end for more information if you want it. So how to get started.
Start of with installing distcc on the computers you have networked together and want to use it on. I assume you already have your computers networked together, so won't be getting into that. To install distcc on Gentoo: emerge distcc .
Now with the program installed, on each machine going to use, start it to run at default runlevels with: rc-update add distccd default .
Except for editing /etc/make.conf you are done. Pretty easy so far. What to put in your make.conf file is partly up to you. Here is mine and I will explain further below:
# Distcc
FEATURES="distcc"
DISTCC_HOSTS="localhost Athlon Compaq"
#DISTCC_LOG="/root/distccd.log" Have not got to work yet.
DISTCC_VERBOSE=1
MAKEOPTS="-j4"
## http://gentoo.superlucidity.net/www/distcc.html said don't do below.
## CC="distcc"
## CXX="distcc g++
The stuff I have uncommented above work for me. Breakdown of my setup for Distcc in /etc/make.conf .
FEATURES="distcc" is part from another line in make.conf.
#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox noclean noauto cvs keeptemp"
You can uncomment the line in make.conf if you want, but there are other things in there also. So rather than delete the other items, I just started my setup with it alone on a line of it's own. I might want to try some of the other FEATURES later and don't want to loose track of what they are.
DISTCC_HOSTS="localhost Athlon Compaq" . This line is where you put your computer names (machine names) of the computers you have using Distcc on your network. You will find the names you have given them, if you forgot, in your /etc/hosts file. If you gave your computers an Alias like I did then you can put that in here like above, or use the fully qualified domain-name if you prefer.
Which order to put them in though. According to the Distcc Home Page you should: Make sure you put the (fastest/closets/least loaded) machine at the start of DISTCC_HOST list. Especially when running ./configure scripts, cause all compilations will will be done on machine 1st listed. Normally localhost, but if another machine is faster than use it. I also seen in the documentation that apparently it is better to use names rather than IP Addresses, even for localhost. Cause using IP Addresses causes it to make a TCP connection to a daemon on localhost,... This is slower, but useful for testing. Not sure about that, and haven't tested it. I would think either way it would make the connection, but I didn't write the program either.
Have tested various combinations though and found that even distcc isn't perfect. Sometimes you will run into a program, especially if compiling on the faster machine, that will compile faster without distcc (probably only though if the other machine is really slow, like my 166Mhz Compaq). I ran into this with a smaller program. Have not tested on something large like Mozilla or KDE though. Here are my results compiling GFtp on my faster machine (Athlon):
DISTCC_HOSTS order: Localhost = L , Athlon = A , Compaq = C : (Also, within a few seconds just count the same time. Depended when I caught it finishing).
So you can see that with NO Distcc, it finished fastest. And did not depend if I had Localhost or Athlon (same computer) first, it finished about the same. It did seem a smidge faster if just put Localhost and didn't include the computer name for Athlon though. Then you see how much time it takes when I have the slower (pentium 166Mhz, Compaq) listed first, then even longer for just the Compaq by itself.
Here are my results compiling GFtp on my slower machine (Compaq):
You can see that it really helped out my slower computer even when localhost is first in the DISTCC_HOST list. Shaved more than 4min off. Then even more when have the Athlon listed first, almost cut the time in half. So you can see that using Distcc can help shorten your compile times on slower computers considerably. Did not test the Compaq with NO Distcc, but would assume it would be around the 10min mark.
DISTCC_VERBOSE="1" is for the verbosity level you want in the log files (namely /var/log/daemon.log and /var/log/syslog).
MAKEOPTS="-j4" is the setting for the number of parallel tasks to run. Some say the number of CPU's using +1, some say twice the number of CPU's available. Actually, both these are on the home page. I chose twice the number of CPU's available so picked 4. Picking more than you need, like say 6 or 9 on my setup, will not make it run faster.
The CC and CXX, there has been discussions on wether to have that in there or not. You can read the link in my setup above and decide. I don't have them included anymore and everything works fine.
How to test if it is running: You can put a tail on /var/log/daemon.log or /var/log/syslog and watch it doing it's stuff. In another terminal tail -f /var/log/syslog . Then just run emerge filename and you will see it working.
Note: There are some programs that won't compile with Distcc. I just ran into libxml, that wouldn't work with it. Then commented out the lines in make.conf and reran it. Have not ran into a lot of programs that would not work with it yet though. So go ahead and use it to speed up your compiling!
Links:
Distcc Home Page.