locked
TFS 2012 BUILD taking a lot of time

    Question

  • Hello,

    I am using TFS 2012 build to build a combination of 45 C projects and 48 C# solutions.

    The entire build process is taking around 30 minutes to complete.

    I am currently not running any test cases, neither do I have any code analysis configured.

    I want to clean the workspace every time I start a build.

    I have the build agent and the build controller running on a standalone virtual machine.

    The build agent has 16GB of RAM and 8 cores.

    I do not understand why the build agent is taking such a long time with all the resources.

    The benchmark has been a in-house build system that builds all of this in approximately 20 minutes.

    I am looking to improve the build time in TFS Builder.

    Any help and pointers would be appreciated.

    Thank you.

    Tuesday, August 6, 2013 4:14 PM

Answers

  • Hi Ballari,

    As you stated in your initial post, you have 45 C projects and 48 C# solutions to build, I think maybe you created many build definitions for these solutions. If you just have one build agent, these queued builds will be put in a queue, the later queued build will not get built until the previous ones completed. So, I think you can set up one more build agent machines so that your build controller can distribute these builds to 2 build agents to run these builds in parallel.

    In addition, as your have very large projects to build, I think you'd better to configure you build definition to run build after work. You can set up it with the Scheduled trigger.

    Thanks.


    Vicky Song
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 12, 2013 8:56 AM
    Moderator
  • Hi Vicky,

    I have created one build definition that has both C, C# projects in them.

    So setting up separate build agents will not work for me.

    As far as running schedule builds are concerned, that is exactly what I am doing.

    Thank you.

    Regards,

    Ballari.

    Monday, August 12, 2013 11:39 AM
  • As it turns out, 7 cores to the builder were added after the TFS Build service was configured on my build machine.

    I initially configured the TFS Build Service with only 1 core.

    I reconfigured the TFS Build Service to use all the 8 cores available.

    Created 2 build definitions for C and C# code and used 2 different build agents for each of these.

    And now my build completes within 10 minutes.

    Thank you for all your suggestions but I should have checked the configuration first.

    • Marked as answer by Ballari Maitra Friday, September 6, 2013 12:48 PM
    Thursday, September 5, 2013 2:48 PM

All replies

  • Hi,

    Thanks for your post.

    Try below steps:

    • Stop indexing sources
    • Deploy only the files that are necessary to run the application
    • Disable "Analyze test impact"
    • Disable "Associate Changesets and Work Items"

    Detailed information you can refer to below blog:

    http://www.sekula.net.pl/post/2012/11/29/How-to-speed-up-TFS-build

     

    Hope it can help.

    Best regards,


    Cece Dong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 7, 2013 9:46 AM
  • Hi Ballari,

    Thanks for your post.

    For this issue, CeCe provided us the helpful suggestions, please confirm that.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 8, 2013 11:00 AM
    Moderator
  • Hi John,

    I tried all the suggestions that CeCe provided.

    But the build is still taking 29.6 minutes to complete.

    Thank you.

    Regards,

    Ballari.

    Thursday, August 8, 2013 12:40 PM
  • Hi Ballari,

    Thanks for your reply.

    If all that suggestions not help you. We strongly recommend you don’t clean the Workspace in build definition, if you want to reduce the build time.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, August 9, 2013 1:31 AM
    Moderator
  • Hi Ballari,

    Can you check the "Getting Sources" operation? How much time it is taking? You might try to revisit and get only the projects you need for compilation.

    This saved me some time before.

    Also, Turn the Logging Verbosity to "Minimal" or "Normal", in  case if you have diagnostic.

    Disable tests to True, if you don't have any tests.

    Thanks,

    Raj

    Friday, August 9, 2013 8:09 PM
  • Hi Raj,

    Thank you for your feedback.

    I am assuming that by "Getting Sources" you mean "Get Workspace" activity in the build logs.

    The total time taken to perform this activity is 29 seconds as per the log.

    Logging is minimal and tests are also disabled.

    I really have no clue how to speed up the build.

    Regards,

    Ballari.

    Friday, August 9, 2013 8:16 PM
  • Hi Ballari,

    As you stated in your initial post, you have 45 C projects and 48 C# solutions to build, I think maybe you created many build definitions for these solutions. If you just have one build agent, these queued builds will be put in a queue, the later queued build will not get built until the previous ones completed. So, I think you can set up one more build agent machines so that your build controller can distribute these builds to 2 build agents to run these builds in parallel.

    In addition, as your have very large projects to build, I think you'd better to configure you build definition to run build after work. You can set up it with the Scheduled trigger.

    Thanks.


    Vicky Song
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 12, 2013 8:56 AM
    Moderator
  • Hi Vicky,

    I have created one build definition that has both C, C# projects in them.

    So setting up separate build agents will not work for me.

    As far as running schedule builds are concerned, that is exactly what I am doing.

    Thank you.

    Regards,

    Ballari.

    Monday, August 12, 2013 11:39 AM
  • Thanks for your response Ballari, and if have any other questions about working with TFS build, welcome back.

    Have a nice day.


    Vicky Song
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 13, 2013 8:41 AM
    Moderator
  • As it turns out, 7 cores to the builder were added after the TFS Build service was configured on my build machine.

    I initially configured the TFS Build Service with only 1 core.

    I reconfigured the TFS Build Service to use all the 8 cores available.

    Created 2 build definitions for C and C# code and used 2 different build agents for each of these.

    And now my build completes within 10 minutes.

    Thank you for all your suggestions but I should have checked the configuration first.

    • Marked as answer by Ballari Maitra Friday, September 6, 2013 12:48 PM
    Thursday, September 5, 2013 2:48 PM