Thursday, March 22, 2012

Distributed Kernel Compilation in Ubuntu

We are going to use "distcc" which is a distributed C/C++ compiler.

1. We have one host machine (Machine A) on which we have downloaded the latest linux kernel sources. The IP address of this machine is

We have one more machine (Machine B) which we are going to run the distributed compiler. The IP address of this machine is

Both the machines are running Ubuntu.

2. On Machine A do the following :

Install distcc :
$sudo apt-get install distcc

Add entry for Machine B in the '/etc/distcc/hosts' file. Comment out '+zeroconf' as given below since we are not going to use it :
# Add a list of hostnames in one line, seperated by spaces, here.
# +zeroconf

Check if the host is added :
$distcc --show-hosts

3. On Machine B do the following :

Install distcc :
$sudo apt-get install distcc

Edit the '/etc/default/distcc' file and set the following parameters :

Start the "distcc" service :
$sudo service distcc start

Now we are ready to start the distributed kernel compilation.

4. Download the latest linux kernel source from and extract it on Machine A. Setup the kernel .config file (refer this guide for more information). Now to start the distributed compilation and even time it :
$time make -j8 CC=distcc
This will start 8 threads and distribute the compilation between Machine A and Machine B

5. Test results :
kernel compilation using single machine :
real 50m55.498s
user 71m4.967s
sys 6m55.030s

kernel compilation using three machines:
real 28m21.146s
user 17m32.862s
sys 4m35.537s


  1. I have read your blog its very attractive and impressive. I like it your blog.
    Linux Training on RHEL 7

  2. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.
    Linux Training Institute in India | Linux Training in India

  3. Nice blog. Explained well. I have suggested to my friends to go through this blog. Very nice explanation. Thank you for sharing this useful information.
    If you want to learn linux course in online, please visit below site
    linux Online Training, linux course, linux online training in kurnool, linux online training in hyderabad, linux online training in bangalore, online courses, online learning, online education, trending courses, best career courses

  4. Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work

    DevOps is currently a popular model currently organizations all over the world moving towards to it. Your post gave a clear idea about knowing the DevOps model and its importance.

    Good to learn about DevOps at this time.

    devops training in chennai | devops training in chennai with placement | devops training in chennai omr | devops training in velachery | devops training in chennai tambaram | devops institutes in chennai | devops certification in chennai | trending technologies list 2018

  5. Its a wonderful post and very helpful, thanks for all this information.
    Linux Training institute in Noida


  6. Digital Lync offers one of the best Online Courses Hyderabad with a comprehensive course curriculum with Continuous Integration, Delivery, and Testing. Elevate your practical knowledge with quizzes, assignments, Competitions, and Hackathons to give a boost to your confidence with our hands-on Full Stack Training. An advantage of the online Cources development course in Hyderabad from Digital Lync is to get industry-ready with Career Guidance and Interview preparation.
    DevOps Training Institute
    Python Training Institute
    AWS Training Institute
    Online Full Stack Developer Course Hyderabad
    Python Course Hyderabad
    Online AWS Training Course Hyderabad
    devops training in hyderabad
    angular training in hyderabad