Monday, June 27, 2011

distcc is my friend!

Last month I spent some time on distcc trying to reduce Kernel build time. The original post is here. I had no success that time. I've tried it again. Now it was a true success. :-)

distcc reduced the build time of Fedora Kernel ~ 53% when using 3 PCs instead of one. From 25m5.938s to 11m52.751s.

Details:

With distcc:
[peter@notepeter SPECS]$ cd /home/peter/distcc/
[peter@notepeter distcc]$ ls -la
total 8
drwxrwxr-x 2 peter peter 4096 Jun 27 20:33 .
drwx------. 49 peter peter 4096 Jun 27 20:48 ..
lrwxrwxrwx 1 peter peter 15 Jun 27 20:33 c++ -> /usr/bin/distcc
lrwxrwxrwx 1 peter peter 15 Jun 27 20:33 cc -> /usr/bin/distcc
lrwxrwxrwx 1 peter peter 15 Jun 27 20:33 g++ -> /usr/bin/distcc
lrwxrwxrwx 1 peter peter 15 Jun 27 20:33 gcc -> /usr/bin/distcc

[peter@notepeter distcc]$ cd -
[peter@notepeter SPECS]$ rpmbuild --clean kernel.spec
[peter@notepeter SPECS]$ export PATH=/home/peter/distcc/:$PATH
[peter@notepeter SPECS]$ export DISTCC_HOSTS='localhost 10.0.0.111 10.0.0.121'
[peter@notepeter SPECS]$ export RPM_BUILD_NCPUS=20
[peter@notepeter SPECS]$ time rpmbuild -bb --with baseonly --without debuginfo --target=`uname -m` kernel.spec

real 11m52.751s
user 20m5.209s
sys 6m47.263s

Without distcc:
[peter@notepeter SPECS]$ rpmbuild --clean kernel.spec
[peter@notepeter SPECS]$ time rpmbuild -bb --with baseonly --without debuginfo --target=`uname -m` kernel.spec

real 25m5.938s
user 69m33.427s
sys 10m57.658s

Hardware:

localhost: Core i7 2620M, 8GB RAM, 256 GB SSD, Gigabit LAN
10.0.0.111: Core2 Quad CPU Q8400, 4GB RAM, 500GB SATA, Gigabit LAN
10.0.0.121: Core2 Quad CPU Q8400, 4GB RAM, 500GB SATA, Gigabit LAN

Reference:

Faster compilation with distcc

No comments:

Post a Comment