[distcc] How to involve the localhost too?

Martin Pool mbp at samba.org
Tue Oct 22 09:34:01 GMT 2002


On 22 Oct 2002, Brad Hards <bhards at bigpond.net.au> wrote:
> Hash: SHA1
> 
> On Tue, 22 Oct 2002 19:00, Alexander.Farber at nokia.com wrote:
> > 	gmake -j4 CC="distcc tcc"
> Can you try -j8 as well? You basically have 4 CPUs, and the sweet spot is 
> claimed to be twice the CPUs available.

Yes, I think it would be good to try both.

The theory behind the "twice the number of CPUs" guideline is this:
sometimes, a job will block because it's waiting for the disk to
either page in a necessary source or header file, or page something
out to make space for objects or output.  If you only run as many jobs
as you have CPUs, then when something blocks for IO that CPU will be
idle, which is a waste.  With slightly too many jobs, then it's likely
that if one job is blocked, another one will be able to proceed.

Since task switching is very efficient on Linux, running twice as many
doesn't have much of a cost.  (An exception is when the machines are
too low on memory to run the compiler and therefore are paging a lot;
presumably not the case for you.)

This rule applies to machines which are mostly idle aside from running
the compiler, which is generally true for workstations and laptops.
If it's a shared machine with many users then possibly something like
make's --max-load option would be more appropriate.

Anyhow, I look forward to seeing your results.  And I have a Nokia
8250, by the way -- I think the onboard software is excellent.

-- 
Martin 

You can get more with a kind word and a gnu than you can with
a kind word alone.



More information about the distcc mailing list