- ALM used - Azure DevOps
- CI system used - Azure DevOps
Hi, I am investigating an issue we have with one of our projects. When we add the Sonar tasks to the build pipeline in Azure DevOps, the build goes from taking 11 mins to taking an hour before timing out.
This is 1 project out of 12, all the others seem to gain an extra 2 or 3 mins adding the sonar tasks.
What advice can you give me to work out what’s going wrong?
To be explicit, it’s the build/compile itself that takes longer, not the job?
Could you share the full job log?
Explicitly yes, the build task is where things seem to stop working.
Our current assumptions are that after collecting all the code, dependencies, setup etc. we are pushing the available limits of memory and SSD capacity of the agent. We think adding the sonar tasks has just pushed it over the edge.
I used the community version of SonarQube and running the build locally. I have found that the build uses over 11gb of ram (without sonar, it’s less but not enough to say there is a problem) and the CPU goes 100% for about 60% of the time. The build agent VM only has 7gb of ram (current specs).
If you require the logs, I will need to request permission. I would think we would require this thread to be private, as I don’t think I will get permission otherwise.
Thanks for clarifying. I’ve flagged this for more expert eyes.
Thanks for your questions and sorry for my delayed response.
In order to be able to investigate this, we would need your help to see what is taking that long.
Could you please send us the logs for BEGIN step (as far as I understand the END doesn’t get to run due to the timeout) in verbose mode and also the dotnet build binary logs with the following parameters set:
/p:reportanalyzer=true /v:d -bl:build.binlog.
/p:reportanalyzer=true /v:d parameters are needed to have relevant performance results included and
-bl:build.binlog is needed to ensure binary logs are generated which helps us a lot.
Regarding the performance, from our measurements the memory size is not that relevant as the processor power. The compiler does a great job at scaling up, and using the resources available by running the analyzers concurrently. The differences in time are noticeable when increasing to 16GB or 32GB.
We also have a guide for troubleshooting performance related issues: The Sonar guide for investigating the performance of .NET analysis
There appears to be some confusion that I would like to try and clear up.
We use SonarCloud using Microsoft Azure DevOps Build Agents. When I last looked the options for the specs of the Build Agent VM’s that we have access to was:
2 core CPU, 7GB Ram, 14Gb SSD
I am unable to find any other options. Hence my confusion with the comment “The differences in time are noticeable when increasing to 16GB or 32GB.” when there are simply no means for us to do this.
Our current workaround is to use a self-hosted solution, which is completing the build within 50mins and it’s only got 8GB of Ram (I am requesting that this is doubled). But the project manager really wants this project to use the Azure Build Agents as per the other projects.
I will try and get you the logs as soon as I can.