<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Electric Cloud Blog &#187; ElectricAccelerator vs distcc</title>
	<atom:link href="http://blog.electric-cloud.com/tag/electricaccelerator-vs-distcc/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.electric-cloud.com</link>
	<description>This is your source for software build-test-deploy best practices and technical tips and tricks for Electric Cloud solutions</description>
	<lastBuildDate>Fri, 30 Jul 2010 00:12:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.electric-cloud.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/69f9c69836db8c4404b635236f654808?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Electric Cloud Blog &#187; ElectricAccelerator vs distcc</title>
		<link>http://blog.electric-cloud.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.electric-cloud.com/osd.xml" title="The Electric Cloud Blog" />
	<atom:link rel='hub' href='http://blog.electric-cloud.com/?pushpress=hub'/>
		<item>
		<title>ElectricAccelerator vs. distcc: samba reloaded</title>
		<link>http://blog.electric-cloud.com/2009/07/20/electricaccelerator-vs-distcc-samba-reloaded/</link>
		<comments>http://blog.electric-cloud.com/2009/07/20/electricaccelerator-vs-distcc-samba-reloaded/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 17:52:18 +0000</pubDate>
		<dc:creator>Eric Melski</dc:creator>
				<category><![CDATA[ElectricAccelerator]]></category>
		<category><![CDATA[distcc]]></category>
		<category><![CDATA[ElectricAccelerator vs distcc]]></category>
		<category><![CDATA[gmake]]></category>
		<category><![CDATA[parallel builds]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=419</guid>
		<description><![CDATA[ElectricAccelerator vs distcc &#8211; samba reloaded In an earlier post I compared the performance of ElectricAcclerator and distcc by building samba using each tool in turn on the same cluster. In that test I found that Accelerator bested distcc at suitably high levels of parallelism, but that distcc narrowly beat Accelerator at lower levels of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.electric-cloud.com&blog=5211544&post=419&subd=ecloud&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<h3>ElectricAccelerator vs distcc &#8211; samba reloaded</h3>
<p>In an <a href="http://blog.electric-cloud.com/2009/03/02/electricaccelerator-vs-distcc-round-3-samba/">earlier post</a> I compared the performance of ElectricAcclerator and distcc by building samba using each tool in turn on the same cluster.  In that test I found that Accelerator bested distcc at suitably high levels of parallelism, but that distcc narrowly beat Accelerator at lower levels of parallelism.  At the time I chalked the difference up to slightly higher overhead associated with Accelerator.  But you must have known I couldn&#8217;t just leave it at that.  I had to know where the overhead was coming from, and eliminate it, if possible.  The exciting conclusion is after the break.<br />
<span id="more-419"></span></p>
<h3>Samba Reloaded</h3>
<p>
To recap, I previously found that samba is a very CPU-intensive build, despite being written entirely in C.  This fact was demonstrated empirically by examining the performance on one dual-core host using just <i>gmake -j</i> at varying levels of parallelism.  Past <i>-j 2</i>, the performance degraded sharply.  For the distcc and emake tests, I used a cluster of 12 dual-core hosts.  Eleven served as workers, for a total of 22 CPU&#8217;s.  The remaining host was used as the build host (and cluster manager, for emake tests).  Here are the original results:
</p>
<p>
<img src="http://ecloud.files.wordpress.com/2009/03/samba_distcc_vs_emake.png" alt="Distcc vs. emake, building samba" />
</p>
<p>
Until we got to about 11 CPU&#8217;s, distcc appeared to have a slight edge on emake.  I had lots of theories that could explain the difference:  maybe our Electric File System (EFS) was slower than ext3fs, or maybe the Electric Agent was sluggish in supplying metadata to the EFS, or in processing file usage data from it.  Maybe lock contention in emake itself was causing the problem.
</p>
<p>
Of course before I could test any of these theories I had to make sure I could reproduce the original behavoir.  I set up a five-node cluster using the same dual-core hosts I used previously, plus one additional node to serve as the build host (unfortunately the other half of the cluster was reserved for other tests &#8212; I&#8217;m not the <i>only</i> person doing work here at Electric Cloud, after all!).  This gave me a total of 10 worker CPU&#8217;s.  After installing the latest version of Accelerator (4.5.0), I fired off a series of three builds each with Accelerator and distcc, using 10 workers.  When those builds completed, I computed the average build time for each tool &#8212; and found that Accelerator beat distcc by a small margin.
</p>
<p><h3>Deeper Into the Rabbit Hole</h3>
</p>
<p>
This result was wholly unexpected, given the results from the previous tests.  The next step was to run a series of builds with varying numbers of workers, from 1 to 10.  Here are the results:
</p>
<p><img src="http://ecloud.files.wordpress.com/2009/07/distcc_versus_emake_default.png" alt="Distcc vs. emake, building samba" />
</p>
<p>
Now the results are more in line with my expecation:  with low levels of parallelism distcc appears to perform better, but Accelerator catches up and finally surpasses distcc once enough resources are engaged.  The breakeven point has moved though, from about 11 CPU&#8217;s to about 9 CPU&#8217;s.  In addition, there was an outlyer in both sets of results:  with just one worker, Accelerator was consistently faster than distcc.  That didn&#8217;t fit well with my theories &#8212; if the EFS was slow, for example, then Accelerator would have been slower than distcc with one worker.
</p>
<p><h3>A New Theory</h3>
<p>As I puzzled over this new data, something clicked that caused me to remember a subtle difference between distcc and Accelerator:  they use different strategies to determine how to allocate jobs to workers in the cluster.  Accelerator prefers to fully load one host before running jobs on another host; distcc prefers to spread the load across as many hosts as possible before doubling up on any one host.  The following images illustrate the result obtained when using these different strategies to assign five parallel jobs to a cluster of ten workers on five hosts:
</p>
<p><img src="http://ecloud.files.wordpress.com/2009/07/emake_distribution.png" alt="Accelerator distribution of jobs to workers in the cluster" />
</p>
<p><img src="http://ecloud.files.wordpress.com/2009/07/distcc_distribution.png" alt="Distcc distribution of jobs to workers in the cluster" />
</p>
<p>
This realization led to a new theory:  perhaps the performance difference observed with low numbers of workers was simply an artifact of this difference in worker allocation strategies.  We&#8217;ve already seen that this particular build is especially CPU intensive.  Two jobs on one host have just two CPU&#8217;s that they must share; two jobs on two hosts have four total CPU&#8217;s available.  This theory would also explain why emake &#8220;catches up&#8221; with distcc &#8212; as more and more jobs are run in parallel, distcc is forced to assign multiple jobs to a single host.  Eventually, both systems have fully loaded all the available cluster nodes, so the difference in allocation strategies becomes moot.
</p>
<p>
Armed with this theory, I altered my benchmark so that emake would use the same allocation strategy as distcc, by explicitly enabling and disabling agents via the cluster manager.  For example, for a trial with two agents, I enabled one agent each on two cluster nodes.  This technique allowed me to better compare the relative performance of distcc and Accelerator.  Here are the results from this test:
</p>
<p><img src="http://ecloud.files.wordpress.com/2009/07/distcc_versus_emake_controlled.png" alt="Distcc vs. emake, building samba, controlled for different allocation strategies" />
</p>
<p>
With the allocation strategy out of the equation, Accelerator actually has a small, consistent edge over distcc (about 2%) on small clusters.  And the previous test showed that Accelerator scales better than distcc, so on large clusters the difference is even more pronounced (about 15%).
</p>
<p><h3>Should We Change Accelerator?</h3>
</p>
<p>
An obvious question is whether we would consider changing the allocation strategy in Accelerator.  The answer is probably no.  The strategy we use, although suboptimal for this particular build, actually works very well across a wide variety of builds.  One of the key advantages of this strategy is that it allows Accelerator to minimize network overhead, since agents on a single host can share various kinds of data directly.  There are relatively few builds that skew so heavily towards CPU utilization, so changing the strategy to benefit those special cases at the expense of the more common case seems unwise.
</p>
<p><h3>A Champion Vindicated</h3>
</p>
<p>
Although we previously declared Accelerator the victor versus distcc when building samba, it was not without some reservations.  With the new results shown here, I&#8217;m satisfied that we made the correct decision:  CPU-for-CPU, Accelerator is more efficient and scales better than distcc, at all cluster sizes.</p>
<br />Posted in ElectricAccelerator Tagged: distcc, ElectricAccelerator, ElectricAccelerator vs distcc, gmake, parallel builds, performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ecloud.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ecloud.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ecloud.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ecloud.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ecloud.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ecloud.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ecloud.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ecloud.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ecloud.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ecloud.wordpress.com/419/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.electric-cloud.com&blog=5211544&post=419&subd=ecloud&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.electric-cloud.com/2009/07/20/electricaccelerator-vs-distcc-samba-reloaded/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6344c5478a4b5f0e8c546c736b2a7e0d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">ericm</media:title>
		</media:content>

		<media:content url="http://ecloud.files.wordpress.com/2009/03/samba_distcc_vs_emake.png" medium="image">
			<media:title type="html">Distcc vs. emake, building samba</media:title>
		</media:content>

		<media:content url="http://ecloud.files.wordpress.com/2009/07/distcc_versus_emake_default.png" medium="image">
			<media:title type="html">Distcc vs. emake, building samba</media:title>
		</media:content>

		<media:content url="http://ecloud.files.wordpress.com/2009/07/emake_distribution.png" medium="image">
			<media:title type="html">Accelerator distribution of jobs to workers in the cluster</media:title>
		</media:content>

		<media:content url="http://ecloud.files.wordpress.com/2009/07/distcc_distribution.png" medium="image">
			<media:title type="html">Distcc distribution of jobs to workers in the cluster</media:title>
		</media:content>

		<media:content url="http://ecloud.files.wordpress.com/2009/07/distcc_versus_emake_controlled.png" medium="image">
			<media:title type="html">Distcc vs. emake, building samba, controlled for different allocation strategies</media:title>
		</media:content>
	</item>
		<item>
		<title>ElectricAccelerator vs. distcc, round 3: samba</title>
		<link>http://blog.electric-cloud.com/2009/03/02/electricaccelerator-vs-distcc-round-3-samba/</link>
		<comments>http://blog.electric-cloud.com/2009/03/02/electricaccelerator-vs-distcc-round-3-samba/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 19:48:13 +0000</pubDate>
		<dc:creator>Eric Melski</dc:creator>
				<category><![CDATA[ElectricAccelerator]]></category>
		<category><![CDATA[distcc]]></category>
		<category><![CDATA[ElectricAccelerator vs distcc]]></category>
		<category><![CDATA[parallel builds]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=234</guid>
		<description><![CDATA[In this continuation of the ElectricAccelerator vs. distcc battle royale, I&#8217;ll compare the performance of these two tools when building samba, a suite of tools that provide file and print services to Windows clients from Unix-like servers. Samba is a particularly interesting package for this comparison because distcc was originally created in order to accelerate [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.electric-cloud.com&blog=5211544&post=234&subd=ecloud&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>In this continuation of the ElectricAccelerator vs. distcc <a href="http://ecloud.wordpress.com/2009/01/26/building-linux-26-with-electricaccelerator-and-distcc/">battle</a> <a href="http://ecloud.wordpress.com/2009/02/10/electricaccelerator-vs-distcc-round-2-mysql/">royale</a>, I&#8217;ll compare the performance of these two tools when building <a href="http://samba.org">samba</a>, a suite of tools that provide file and print services to Windows clients from Unix-like servers.  Samba is a particularly interesting package for this comparison because distcc was originally created in order to accelerate samba builds, and until <a href="http://distcc.samba.org/news.html">recently</a>, the distcc project was hosted by the samba organization.  In some sense, samba is the poster child for distcc acceleration, so it should work quite well with distcc.<br />
<span id="more-234"></span></p>
<p>
For this investigation, there are two things that are really interesting about the samba project.  First, although it is written entirely in C, it is a highly CPU intense build.  This runs counter to my intuition and experience, which is that C compiles tend to be relatively light in terms of CPU usage (at least in comparison with C++ compiles, for example).  You&#8217;ll see the evidence and impact of this in the results below.
</p>
<p>
Second, the samba build is structured as a single, non-recursive make invocation.  This is markedly different from the other projects I&#8217;ve previously built in this series, both of which were built using the traditional recursive make style.  The principal advantage of a non-recursive make build is that it enables you to completely, precisely specify all the dependencies across the entire system.  In theory, this means that the build should be able to run at very high levels of parallelism, much higher than you might see with a typical recursive make build, due to the manner in which parallelism is implemented in gmake.  It also means that in this comparison Accelerator is denied the benefit of one of its key optimizations, which is the ability to coalesce recursive makes into a single logical make.  Or, to put it another way, it enables the gmake build to compete with Accelerator on a more even footing.
</p>
<p>
These tests were performed on a cluster of 12 physical servers, each with Dual 2.4GHz Xeon CPU&#8217;s with hyperthreading enabled.  One system was designated the build host (and cluster manager, for Accelerator tests); the remaining hosts were used as worker nodes.  The build host had 2 GB RAM, and the workers had 1.5 GB each.  All systems were connected by a dedicated gigabit Ethernet switch, and they were all running RedHat Desktop 3, update 8.  I used GNU make 3.79.1; distcc 3.1; and ElectricAccelerator 4.3.1.25685.  I built samba 3.3.0, the latest release available at the time I did the tests.
</p>
<p>
Samba built cleanly out-of-the-box with both Accelerator and gmake with distcc in &#8220;pump&#8221; mode.  As before I used a trivial driver script to simplify the process of running the builds at various levels of parallelism from 1 to 22; that script simply extracted a clean copy of the sources, ran <code>configure</code> and started the build.  I won&#8217;t bother reproducing the script here since there&#8217;s nothing magic in it, but it is available on request if somebody really wants to see it.
</p>
<p><h3>Results</h3>
<p>First, let&#8217;s look at the complete results for all three build tools:  gmake alone; gmake with distcc; and Accelerator (emake):
</p>
<p>
<img src="http://ecloud.files.wordpress.com/2009/03/samba_all.png"/>
</p>
<p>
Although it&#8217;s hard to see the differences between distcc and emake in this view, I wanted to include it in order to make a couple points about the performance of gmake alone on this build.  As I said previously, this is a build that is very CPU intense.  You can see the evidence of that in the performance data for gmake.  Serially, the build runs in 30m46s; with -j2, the build time is reduced to 18m11s, about 1.7x faster.  But after that point, trying to increase the parallelism actually makes the build run slower!  This is because at -j2 we&#8217;ve already completed saturated the CPU&#8217;s on the build host.  If the build were less CPU intensive, we would have seen some (possibly very small) improvement at higher levels, at least until we reached the point of saturation.
</p>
<p>
Now let&#8217;s focus on the distcc and emake results starting with 5 workers, so that we can really get a good look at the difference at high levels of parallelism:
</p>
<p>
<img src="http://ecloud.files.wordpress.com/2009/03/samba_distcc_vs_emake.png"/>
</p>
<p>
With this graph we can see some really interesting things.  First, distcc beats Accelerator at low levels of parallelism, but Accelerator steadily gains on distcc with each additional CPU brought into the build.  With about 11 CPU&#8217;s in use, performance is tied.  Past that, Accelerator takes and holds the lead.  These results were a bit of a head scratcher for me.  I was pleased to see that Accelerator won out in the end, but I was surprised that distcc demonstrated that early advantage, and that it maintained it for so long.  After a few days of puzzling over this, I decided this must be the evidence of two separate factors playing together.
</p>
<p>
First, Accelerator seems to have slightly higher overhead per job run in the build.  This explains why distcc beats Accelerator on this build at low levels of parallelism.  But the overhead is pretty small &#8212; maybe 10% at most, and in the end, the performance is dominated by the second factor:  Accelerator scales better than distcc, so it is able to bring more CPU&#8217;s to bear on the task.  The fact that Accelerator can run more jobs in parallel more than makes up for the small additional overhead.</p>
<h3>Conclusion</h3>
<p>Although distcc had an early lead in this round, in the end Accelerator is the clear winner.  Here&#8217;s the updated scorecard:
</p>
<table rules="rows columns" border cellpadding="8">
<tr style="background:#e0e0e0;">
<th>Package</th>
<th>Best distcc time</th>
<th>Best Accelerator time</th>
<th>Advantage</th>
</tr>
<tr style="background:#ffffce;">
<td><a href="http://ecloud.wordpress.com/2009/01/26/building-linux-26-with-electricaccelerator-and-distcc/">Linux 2.6.28.1</a></td>
<td align="right">4m25s</td>
<td align="right">2m38s</td>
<td><b>Accelerator</b></td>
</tr>
<tr style="background:#deffde;">
<td><a href="http://ecloud.wordpress.com/2009/02/10/electricaccelerator-vs-distcc-round-2-mysql/">MySQL 5.1.31</a></td>
<td align="right">4m15s</td>
<td align="right">1m49s</td>
<td><b>Accelerator</b></td>
</tr>
<tr style="background:#ffffce;">
<td><a href="http://ecloud.wordpress.com/2009/03/02/electricaccelerator-vs-distcc-round-3-samba/">Samba 3.3.0</a></td>
<td align="right">2m10s</td>
<td align="right">1m51s</td>
<td><b>Accelerator</b></td>
</tr>
</table>
<p>Still, it&#8217;s clear that there&#8217;s room for improvement in spite of this victory.  That&#8217;s good though &#8212; as they say, people seldom improve when they have no other model but themselves to copy after.
</p>
<p><b>UPDATE:</b> I finally got time to examine this build more closely.  The results of my investigation are <a href="http://blog.electric-cloud.com/2009/07/20/electricaccelerator-vs-distcc-samba-reloaded/">here</a>.</p>
<br />Posted in ElectricAccelerator Tagged: distcc, ElectricAccelerator, ElectricAccelerator vs distcc, parallel builds, performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ecloud.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ecloud.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ecloud.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ecloud.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ecloud.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ecloud.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ecloud.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ecloud.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ecloud.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ecloud.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.electric-cloud.com&blog=5211544&post=234&subd=ecloud&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.electric-cloud.com/2009/03/02/electricaccelerator-vs-distcc-round-3-samba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6344c5478a4b5f0e8c546c736b2a7e0d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">ericm</media:title>
		</media:content>

		<media:content url="http://ecloud.files.wordpress.com/2009/03/samba_all.png" medium="image" />

		<media:content url="http://ecloud.files.wordpress.com/2009/03/samba_distcc_vs_emake.png" medium="image" />
	</item>
		<item>
		<title>ElectricAccelerator vs. distcc, round 2: MySQL</title>
		<link>http://blog.electric-cloud.com/2009/02/10/electricaccelerator-vs-distcc-round-2-mysql/</link>
		<comments>http://blog.electric-cloud.com/2009/02/10/electricaccelerator-vs-distcc-round-2-mysql/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 20:58:55 +0000</pubDate>
		<dc:creator>Eric Melski</dc:creator>
				<category><![CDATA[ElectricAccelerator]]></category>
		<category><![CDATA[distcc]]></category>
		<category><![CDATA[ElectricAccelerator vs distcc]]></category>
		<category><![CDATA[parallel builds]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=223</guid>
		<description><![CDATA[Previously we have compared the performance of ElectricAccelerator and distcc when building the Linux 2.6 kernel. In what I hope will be the first of several followups, I will repeat the experiment with different software packages, to determine whether that result was a one-off, or whether ElectricAccelerator really is consistently better performing than distcc. In [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.electric-cloud.com&blog=5211544&post=223&subd=ecloud&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Previously we have <a href="http://ecloud.wordpress.com/2009/01/26/building-linux-26-with-electricaccelerator-and-distcc/">compared the performance of ElectricAccelerator and distcc when building the Linux 2.6 kernel</a>.  In what I hope will be the first of several followups, I will repeat the experiment with different software packages, to determine whether that result was a one-off, or whether ElectricAccelerator really is consistently better performing than distcc.  In this round, we&#8217;ll be building <a href="http://mysql.com/">MySQL</a>, a popular free-for-non-commercial-use database server.<br />
<span id="more-223"></span><br />
MySQL is not as large as the Linux kernel, but it is still reasonably large by open source standards:  about 7,000 total files (including both source and non-source files) in the source distribution.  The code is written in both C and C++, which is a significant difference from the Linux kernel, which is exclusively C (and assembly, of course) as far as I know.  The serial build time on my test hardware is 20m2.8s (average after four runs).  For those who haven&#8217;t read the previous articles, the test setup consists of nine physical servers configured as follows:</p>
<ul>
<li>Dual Xeon 2.4GHz hyperthreaded CPU&#8217;s</li>
<li>8 systems with 1.5GB RAM; one system with 2GB RAM</li>
<li>Gigabyte Ethernet connections on a dedicated switch</li>
<li>RedHat Desktop 3, update 8</li>
</ul>
<p>
I used the following software packages in this test:</p>
<ul>
<li>GNU make 3.79.1</li>
<li>distcc 3.1</li>
<li>ElectricAccelerator 4.3.1.25685</li>
<li>MySQL 5.1.31</li>
</ul>
<p><h3>Process</h3>
<p>As previously, I used a driver script to simplify running the tests:
</p>
<p><pre class="brush: python;">
#!/bin/sh

gver=&quot;`make --version | head -1 | awk '{ print $4 }' | sed -e s/,//`&quot;
PATH=/opt/ecloud/i686_Linux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

package=mysql-5.1.31
unset ARCH
unset OUTTOP
unset LD_LIBRARY_PATH
DISTCC_POTENTIAL_HOSTS='blade1 blade2 blade4 blade5 blade6 blade7 blade10 blade11'
export DISTCC_DIR=`/bin/pwd`/.distcc
export DISTCC_POTENTIAL_HOSTS

mkdir &quot;distcc-3.1-pump&quot;
(
  for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  do
    pfx=../distcc-3.1-pump/distcc$i
    rm -rf &quot;$package&quot;
    tar xzf &quot;$package.tar.gz&quot;
    cd &quot;$package&quot;
    ./configure

    rm -f $DISTCC_DIR/lock/*
    (time pump make -j $i CC=distcc CXX=&quot;distcc g++&quot; \
      $targets \
    ) &lt; /dev/null &gt; &quot;$pfx.out&quot; 2&gt;&amp;1
    cd ..
  done

  echo DONE
) &lt; /dev/null &gt; &quot;distcc-3.1-pump/dtest.out&quot; 2&gt;&amp;1
</pre>
</p>
<p>
MySQL built cleanly out-of-the-box with both distcc and Accelerator:  no makefile modifications were required, and distcc&#8217;s &#8220;pump&#8221; mode worked with no additional configuration needed.  You can see for this comparison I ran the build with varying levels of parallelism (by altering the -j parameter for the distcc runs, and by altering the &#8211;emake-maxagents parameter for the Accelerator runs).  This gave me the data needed to show how distcc and Accelerator scale as you add more and more nodes to your cluster.  Note that although the driver script only does one run at each level of parallelism, I ran the driver script in its entirety three times, so that I could get a good average time for each build tool at each level of parallelism.  Also note that I ran the Accelerator build once to generate a history file which was used for subsequent runs; the time for that initial build is not included in the results.
</p>
<p><h3>Results</h3>
<p>Here are the results:
</p>
<p>
<img />
</p>
<p>
There are a few things I find interesting about this result.  First, of course, is the fact that Accelerator beats distcc, by a significant margin at high levels of parallelism.  The best time delivered by distcc is about 4m15s, about 4.7x faster than serial time.  The best time delivered by Accelerator is about 1m49s, about 11x faster than serial time.  According to ElectricInsight, our build visualization and analysis tool, the best possible time for this build is about 1m20s, based on the dependency graph for the build.
</p>
<p>
It&#8217;s also interesting to compare the performance of <code>gmake -j</code> with and without distcc.  On its own, <code>gmake -j</code> provides about a 1.9x improvement, which is about what you would expect given that the build system has two physical CPU&#8217;s.  However, that tells us that of the total 4.7x improvement obtained with <code>gmake -j</code> and distcc, the addition of distcc only accounts for about 2.5x (NB: to get the total improvement from multiple techniques used in conjunction, you can multiply the improvement from each; for example, 2.5x times 1.9x is about 4.7x).
</p>
<p>
The next interesting thing is that Accelerator scales better on this build.  gmake with distcc maxes out roughly when parallelism is about 10 or 11; Accelerator continues to see gains until it hits about 16 agents.
</p>
<p>
Finally, there is the surprising step result in the Accelerator timings:  there is a significant improvement each time the number of agents is pushed passed a multiple of three.  I believe this is an artifact of the way I have the cluster configured, with three agents per dual CPU host.  The agent allocation algorithm in Accelerator tends to prefer to grab agents on the same host before grabbing agents from a different host, so most likely we&#8217;re seeing the effect of completely loading up one host followed by the addition of another host to the in-use pool.
</p>
<p><h3>Conclusion</h3>
<p>It looks like Accelerator wins this round.  Here&#8217;s the updated scorecard:
</p>
<table rules="rows columns" border cellpadding="8">
<tr style="background:#e0e0e0;">
<th>Package</th>
<th>Best distcc time</th>
<th>Best Accelerator time</th>
<th>Advantage</th>
</tr>
<tr style="background:#ffffce;">
<td><a href="http://ecloud.wordpress.com/2009/01/26/building-linux-26-with-electricaccelerator-and-distcc/">Linux 2.6.28.1</a></td>
<td align="right">4m25s</td>
<td align="right">2m38s</td>
<td><b>Accelerator</b></td>
</tr>
<tr style="background:#deffde;">
<td><a href="http://ecloud.wordpress.com/2009/02/10/electric-accelerator-vs-distcc-round-2-mysql/">MySQL 5.1.31</a></td>
<td align="right">4m15s</td>
<td align="right">1m49s</td>
<td><b>Accelerator</b></td>
</tr>
</table>
<br />Posted in ElectricAccelerator Tagged: distcc, ElectricAccelerator, ElectricAccelerator vs distcc, parallel builds, performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ecloud.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ecloud.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ecloud.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ecloud.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ecloud.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ecloud.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ecloud.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ecloud.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ecloud.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ecloud.wordpress.com/223/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.electric-cloud.com&blog=5211544&post=223&subd=ecloud&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.electric-cloud.com/2009/02/10/electricaccelerator-vs-distcc-round-2-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6344c5478a4b5f0e8c546c736b2a7e0d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">ericm</media:title>
		</media:content>
	</item>
		<item>
		<title>Building Linux 2.6 with ElectricAccelerator and distcc</title>
		<link>http://blog.electric-cloud.com/2009/01/26/building-linux-26-with-electricaccelerator-and-distcc/</link>
		<comments>http://blog.electric-cloud.com/2009/01/26/building-linux-26-with-electricaccelerator-and-distcc/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 23:41:45 +0000</pubDate>
		<dc:creator>Eric Melski</dc:creator>
				<category><![CDATA[ElectricAccelerator]]></category>
		<category><![CDATA[distcc]]></category>
		<category><![CDATA[ElectricAccelerator vs distcc]]></category>
		<category><![CDATA[parallel builds]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=210</guid>
		<description><![CDATA[There are lots of different parallel, distributed build systems in the world besides ElectricAccelerator. In this post, I&#8217;m going to share my recent experience with one popular alternative, GNU make combined with distcc. Distcc uses an interesting approach to accelerating builds. It leverages the parallel facilities built into GNU make itself, and adds a distribution [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.electric-cloud.com&blog=5211544&post=210&subd=ecloud&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>There are lots of different parallel, distributed build systems in the world besides ElectricAccelerator.  In this post, I&#8217;m going to share my recent experience with one popular alternative, GNU make combined with <a href="http://code.google.com/p/distcc/">distcc</a>.<br />
<span id="more-210"></span></p>
<p>
Distcc uses an interesting approach to accelerating builds.  It leverages the parallel facilities built into GNU make itself, and adds a distribution mechanism that enables it to take advantage of networked CPU resources.  This week I decided to take a look at distcc 3.1, which was released in December 2008.  It&#8217;s been some time since I last tried it, so I figured it was worth some time to see how the project has evolved and how it compares to Accelerator in its latest incarnation.
</p>
<p><h3>Setup</h3>
<p>For this experiment, I chose to build the <code>bzImage</code> and <code>modules</code> targets of the Linux 2.6 kernel for the following reasons:
</p>
<ul>
<li>Including <code>modules</code>, the Linux 2.6 kernel build is fairly substantial &#8212; around 20,000 source files</li>
<li>It&#8217;s freely available, should anybody want to replicate my experiments.</li>
<li>It&#8217;s well-known, so if I have made a foolish error in my tests it will be easier for other people to detect and correct.</li>
<li>The build system was deliberately designed to facilitate parallel builds.</li>
</ul>
<p>
I used the following packages in my tests:
</p>
<ul>
<li>GNU make 3.79.1</li>
<li>Distcc 3.1</li>
<li>Linux 2.6.28.1</li>
<li>ElectricAccelerator 4.3.1.25685</li>
</ul>
<p>
Finally, my test hardware consisted of 9 systems configured as follows:</p>
<ul>
<li>Dual Xeon 2.4GHz with hyperthreading enabled</li>
<li>8 systems with 1.5 GB RAM; one system with 2 GB RAM</li>
<li>Gigabit Ethernet connections on a dedicated switch</li>
<li>RedHat Desktop 3, update 8</li>
</ul>
<p><h3>Process</h3>
<p>After downloading the kernel sources, I unpacked them and used <code>make menuconfig</code> to generate a .config file with all default settings, which I saved for reuse to ensure that each test run used an identical configuration.  I wrote a simple driver script for the tests:
</p>
<p><pre class="brush: python;">
gver=&quot;`make --version | head -1 | awk '{ print $4 }' | sed -e s/,//`&quot;
lver=&quot;2.6.28.1&quot;
targets=&quot;bzImage modules&quot;
mkdir gmake-$gver
(
  rm -rf &quot;linux-$lver&quot;
  tar xjf &quot;linux-$lver.tar.bz2&quot;
  cd &quot;linux-$lver&quot;
  patch -p0 -i ../&quot;linux-$lver.patch&quot;

  for i in 1 2 3 4
  do
    pfx=../gmake-$gver/gmake$i

    make distclean
    cp ../&quot;linux-$lver.config&quot; .config
    make silentoldconfig

    (time make \
      $targets \
    ) &lt; /dev/null &gt; &quot;$pfx.out&quot; 2&gt;&amp;1
  done

  echo DONE
) &lt; /dev/null &gt; &quot;gmake-$gver/gtest.out&quot; 2&gt;&amp;1
</pre>
</p>
<p>
Attentive readers will have noticed that I&#8217;m applying a patch to the kernel sources before running the build.  That patch just removes a couple instances of the order-only prerequisite feature in the kernel makefiles, because neither gmake 3.79.1 nor Accelerator 4.3.1 support that feature.
</p>
<p><h3>Serial build</h3>
</p>
<p>
Collecting serial build times was completely uneventful.  The build ran successfully, albeit slowly, but then that&#8217;s why we&#8217;re here, right?
</p>
<p><h3>ElectricAccelerator build</h3>
<p>After collecting serial build times, I tweaked the driver script to accomodate building with emake.  For these tests, I used the system with 2 GB RAM as both cluster manager and emake host, and configured the remaining systems as agent nodes running three agents each.  ElectricMake built the 2.6 kernel out-of-the-box, without any special configuration required.  I did run one build to generate a history file, then used that history file for each of the subsequent runs, although for this build, the impact of the history file was negligable (that is, there are very few missing dependencies in the build), which is to be expected given the amount of work put into making the build parallel friendly.
</p>
<p><h3>Distcc build</h3>
<p>Finally, I retooled the script one more time to accomodate building with distcc.  For these runs, I used the system with 2 GB RAM as the build host, and used the remaining systems as distcc servers; I invoked distcc in &#8220;pump mode&#8221; with <code>gmake -j 16</code>.  The build ran successfully, but I found errors in the build log indicating that &#8220;pump mode&#8221;, the banner feature of distcc 3.x, had been disabled, meaning that the build performance was negatively impacted (error formatted for legibility):
</p>
<div style="background:#ffcfce;border:dashed thin;width:80ex;">
<pre>
ERROR: compile arch/x86/kernel/asm-offsets.c on blade10,cpp,lzo failed
Warning: remote compilation of 'arch/x86/kernel/asm-offsets.c' failed,
    retried locally and got a different result.
Warning: file 'include/linux/autoconf.h', a dependency of
    arch/x86/kernel/asm-offsets.c, changed during the build
Warning: now using plain distcc, possibly due to inconsistent file system
    changes during build
</pre>
</div>
<p>
After some investigation I learned that pump mode <a href="http://distcc.googlecode.com/svn/trunk/doc/web/man/include_server_1.html#TOC_6">does not automatically handle header files that are modified during the build</a>.  I applied the prescribed workaround, with the addition of the specific header file mentioned in the error message I received, and tried again&#8230; with the same result.  After several more iterations, covering one and a half days and including some detailed analysis of the build made possible by Accelerator&#8217;s file-level annotation, I managed to get distcc working in pump mode.  Note that plain distcc worked out-of-the-box; it was only pump mode that gave me trouble (details available on request).
</p>
<p>
Once I worked out the kinks, I reran the distcc tests with <code>-j 8</code> and <code>-j 24</code>; and I tried including &#8220;localhost&#8221; as one of the distcc compile servers.  At best these changes had no impact on performance; most of them made the build slightly slower.
</p>
<p><h3>Results and Analysis</h3>
</p>
<table rules="rows columns" border cellpadding="8">
<tr style="background:#e0e0e0;">
<th>Build tool</th>
<th>Average (4 runs)</th>
<th>Standard deviation</th>
<th>Comparison to serial</th>
</tr>
<tr style="background:#ffffce;">
<td>Serial gmake</td>
<td align="right"><b>32m29.25s</b></td>
<td align="right"><b>4.99s</b></td>
<td align="right"><b>1.0x</b></td>
</tr>
<tr style="background:#deffde;">
<td>Distcc/gmake</td>
<td align="right"><b>4m25.75s</b></td>
<td align="right"><b>4.50s</b></td>
<td align="right"><b>7.35x faster</b></td>
</tr>
<tr style="background:#ffffce;">
<td>ElectricAccelerator</td>
<td align="right"><b>2m38.00s</b></td>
<td align="right"><b>1.41s</b></td>
<td align="right"><b>12.34x faster</b></td>
</tr>
</table>
<p>
As you can see, both distcc and Accelerator do a good job of accelerating the build, but for raw speed (and, I think, for ease of implementation) Accelerator takes the crown on this one.  Why is that so?  I think there are two factors that contribute to our success here:
</p>
<ol>
<li>Accelerator distributes <b>all</b> work to the cluster: in addition to compiles, Accelerator distributes code gen, links, packaging, and even makefile parsing to the cluster.  This significantly increases the amount of work that can be done in parallel, and reduces the amount of work performed on the build host itself, preventing it from becoming a bottleneck.
</p>
</li>
<li>Accelerator aggressively parallelizes recursive make invocations.  In a variety of common situations, gmake does not parallelize recursive makes, even when invoked with <code>-j</code>.  For example:
<div style="background:#dee7f7;border:dashed thin;width:80ex;">
<pre>
all:
    $(MAKE) util
    $(MAKE) app1
    $(MAKE) app2
    $(MAKE) app3
</pre>
</div>
<p>
In this situation, gmake will not parallelize the work in the recursive makes, and in fact it cannot &#8212; to do so runs the risk of breaking the build.  But Accelerator can and does parallelize the recursive makes, and it can do so safely because of our conflict detection and resolution technology.  This often gives us an edge over other build systems, particularly if there is substantial work in recursive makes.  Of course, since distcc uses gmake to handle parallelization, it is subject to the same limitations.
</p>
</li>
</ol>
<p>
It&#8217;s worth mentioning that Accelerator also has an edge in terms of the artifacts left over after the build completes.  When the distcc builds finished, I had the build output and the standard build log.  When the Accelerator builds finished, I had those same artifacts as well as an Accelerator annotation file, which as you know provides a gold mine of performance and dependency information about the build, which personally I find indispensable.
</p>
<p><h3>Conclusion</h3>
</p>
<p>
Although distcc is more capable now than ever before, in the most important measure &#8212; raw speed &#8212; Accelerator still beats it hands down.  I think this experiment also underscores the shortcomings of distcc&#8217;s approach to build acceleration &#8212; without distributing more work to the cluster, I don&#8217;t know that distcc will ever be able to match Accelerator for speed, at least for large builds that produce multiple outputs.  For smaller, simpler builds, who knows &#8212; but then, that&#8217;s not really the target that Accelerator is aiming for.</p>
<br />Posted in ElectricAccelerator Tagged: distcc, ElectricAccelerator, ElectricAccelerator vs distcc, parallel builds, performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ecloud.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ecloud.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ecloud.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ecloud.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ecloud.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ecloud.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ecloud.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ecloud.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ecloud.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ecloud.wordpress.com/210/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.electric-cloud.com&blog=5211544&post=210&subd=ecloud&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.electric-cloud.com/2009/01/26/building-linux-26-with-electricaccelerator-and-distcc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6344c5478a4b5f0e8c546c736b2a7e0d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">ericm</media:title>
		</media:content>
	</item>
	</channel>
</rss>