Our team has set up continuous integration using visual studio online. We have tried cranking up our subscription to advanced with a paid build limit that we are nowhere near reaching. However, build times are exceptionally slow.
The builds will sit in a queue for several minutes then take several minutes to run [even when testing adding Nuget packages to source control].
Is there any way to speed up builds in Visual Studio Online? If not what are some good alternatives?
I see acceptance or setting up our own continuous integration server on an Azure VM as a worst case fallback.
The Hosted build servers suffer a few flaws. First, they're always clean images with nothing preserved, so your sources, packages and previously built binaries are not available. Because of this, the only way to further speed up the build is to:
BuildInParallel
to allow MsBuild to spin up multiple instances and enable MaxCpuCount=2
to use multiple CPU cores available on the hosted agents. It looks like they run on an A3 instance, which gives you 4 cores to play with. If you're using both BuildInParallel
and MaxCpuCount
don't max out the number of cores on MaxCpuCount
.OutputPath
.This is about as much as you can do. You can't rent faster VM's in the hosted pool and you can't use any of the features in MsBuild which would allow you to do incremental builds or at least incremental updates of the workspace. and there is no way to remove the initialization time of the agent and the source retrieval.
To really speed up, you'll need to setup your own build server. Using a DS Azure VM running on a permanent SSD will give you the most performance benefit. With your own VM you can do the following additional things:
Instead of hosting the agent on Azure, you can install a local build agent on a beefy developer workstation or an existing local server as well.
There are other MsBuild tips and tricks you could apply to further iprove performance of MsBuild. It may amaze you how much time you can shave off your builds that way.