I recently tested distcc with a setup of 1 master + 2 slave nodes for ports building (slaves are diskless, booting off master). Some observations and questions about this:
OBSERVATIONS:
- The nodes have 1G RAM and a small HDD attached for SWAP. The HDD is not necessary as 1G is more than enough for the node to do it's job.
- My /usr/local/etc/distcc/hosts file has 127.0.0.1 as last entry with 2 threads allocated, nodes use full threads and lzo compression for communication. /usr is exported via NFS so nodes have same ports structure as master.
However, the most noticeable performance improvement came when I mounted a separate HDD on to /usr/obj. This second HDD was considerably slower than my main HDD, but the separation freed master node's HDD to pass code to slaves much faster.
- 1 Node was enough and even then was very often idle. Many ports do not build with makejobs and some ports have bootstrap layers so I guess they cannot distribute from the "chrooted" build environment they create for themselves (like lang/gcc46 and java ports). Others just don't like distcc (devel/boost-libs).
PROBLEM: This causes the master node to be completely tied-up during non-distributable builds while the nodes sit idle.
NEW SCENARIO: Dedicated build node employing distcc.
- Make node1 do the builds (run portmaster from node1), place an HDD on node1 and direct the WORKDIRPREFIX there.
- Run portmaster with the "-g" option and from a list of ports (not portmaster -a) to create packages. Later, upgrade all ports on /usr/local through packages from PKGREPOSITORY (portmaster -PP).
- Run distcc but change host entry order to "node2 node1 master". This way master only serves the distfiles and ccache shared over nfs, collects the created packages.
QUESTION: Any better solutions to this problem? What other approach can be taken?
- The only major problem with this is that FreeBSD requires the built port to be installed before it creates a package for it (same under # make package-noinstall).
- If the ports built on node1 are to be installed before package_create, /usr will have to be exported with r/w access as well as /var/db/ports and /var/db/pkg (very ugly).
- One work-around would be to have node1 run all the builds (just make, no install) then export through nfs the folder /usr/obj (or wherever WORKDIRPREFIX has been mounted on node1. Then, master-node can run portmaster with "-C" (don't clean before) and install from ready-made builds.
EDIT ON LAST PARAGRAPH: Some ports try to install certain things in usr even if you just "make" (mostly KDE stuff I guess). But one strange thing I keep coming up with is that .configure cannot find the installed devel/libtools and tries to install the "missing" libtools??
OBSERVATIONS:
- The nodes have 1G RAM and a small HDD attached for SWAP. The HDD is not necessary as 1G is more than enough for the node to do it's job.
- My /usr/local/etc/distcc/hosts file has 127.0.0.1 as last entry with 2 threads allocated, nodes use full threads and lzo compression for communication. /usr is exported via NFS so nodes have same ports structure as master.
Code:
node1/4,lzo node2/4,lzo 127.0.0.1/2
- 1 Node was enough and even then was very often idle. Many ports do not build with makejobs and some ports have bootstrap layers so I guess they cannot distribute from the "chrooted" build environment they create for themselves (like lang/gcc46 and java ports). Others just don't like distcc (devel/boost-libs).
PROBLEM: This causes the master node to be completely tied-up during non-distributable builds while the nodes sit idle.
NEW SCENARIO: Dedicated build node employing distcc.
- Make node1 do the builds (run portmaster from node1), place an HDD on node1 and direct the WORKDIRPREFIX there.
- Run portmaster with the "-g" option and from a list of ports (not portmaster -a) to create packages. Later, upgrade all ports on /usr/local through packages from PKGREPOSITORY (portmaster -PP).
- Run distcc but change host entry order to "node2 node1 master". This way master only serves the distfiles and ccache shared over nfs, collects the created packages.
QUESTION: Any better solutions to this problem? What other approach can be taken?
- The only major problem with this is that FreeBSD requires the built port to be installed before it creates a package for it (same under # make package-noinstall).
- If the ports built on node1 are to be installed before package_create, /usr will have to be exported with r/w access as well as /var/db/ports and /var/db/pkg (very ugly).
- One work-around would be to have node1 run all the builds (just make, no install) then export through nfs the folder /usr/obj (or wherever WORKDIRPREFIX has been mounted on node1. Then, master-node can run portmaster with "-C" (don't clean before) and install from ready-made builds.
EDIT ON LAST PARAGRAPH: Some ports try to install certain things in usr even if you just "make" (mostly KDE stuff I guess). But one strange thing I keep coming up with is that .configure cannot find the installed devel/libtools and tries to install the "missing" libtools??