Partager via


Node Reuse in MultiProc MSBuild

Greetings MSBuilders!

 

With the MultiProc support in MSBuild Orcas (now available in Visual Studio Orcas Beta 1), we’ve added the ability to reuse the MSBuild child nodes between builds. When you’re doing multiple builds in a row, this helps reduce your total build time, by avoiding the start up costs of each child node. By default, when doing a MultiProc build (using /m:2 or greater), nodeReuse is enabled.

 

Example: You have dirs.proj (a traversal project) that builds p1.proj, p2.proj, and p3.proj. Using the following command line to /m:3 dirs.proj

 

You will get 3 MSBuild nodes started, one parent node with 2 child nodes. The 2 child nodes will, by default in this example, remain after your build completes. If you were to build again (same projects, or different, with 2 or more nodes), the 2 child nodes will be re-used by that build.

 

Things to know with nodeReuse. The timeout value for these child nodes is 60 seconds if they remain idle, before they will be terminated. Because of these 60 second timeout, if you’re not doing multiple builds, you can disable nodeReuse (/nr:false) to avoid the extra processes from running after your build completes. If a node was started by another user or the same user with different elevation access (Vista), those child nodes will not be reused. You can only reuse a node that you created with the same level of access that they were started in.

 

[ Author: Eric, MSBuild Software Engineer ]

Comments

  • Anonymous
    April 17, 2007
    Todd Mancini on Configuring Visual Studio 2005 Team Foundation Server with Windows Sharepoint Services...

  • Anonymous
    April 19, 2007
    A bit confused by the messaging, MSBuild is in the .NET Framework and not in Visual Studio - can you confirm that this is actually a feature of .NET Framework 3.5 rather than Visual Studio Orcas?

  • Anonymous
    April 22, 2007
    The comment has been removed

  • Anonymous
    April 25, 2007
    Stuart, MSBuild ships inside the .NET Framework Redistributable so all these features are part of .NET Framework 3.5. However, Visual Studio Orcas also includes the 3.5 redist, so if you install Orcas you'll see this stuff there as well. Neil

  • Anonymous
    June 26, 2007
    The comment has been removed

  • Anonymous
    July 28, 2009
    Nice concept. Great teamwork guys!

  • Anonymous
    September 16, 2009
    I think that the node reuse aspect of this is that the nodes which have been started by the parent will automatically not go away. And if you start a second build - the same nodes will be reused saving us the process start up time.