I am building a .Net Framework solution in AzuRe DevOps with SonarCloud, I was expecting the build to be slower but not by this much.
The MSBuild step before integrating with SonarCloud took on avg 1.5 mins, after integration it takes over 13 mins , and on top of it it takes another 8 mins (and sometimes more) to run the code analysis, so from less than 2 mins it now takes over 20 minutes to run.
Does anyone have any configuration tips for reducing the time it takes to run with SonarCloud?
My build agents are Azure VMs, what would improve performance more, adding more memory or CPU?
Hi @alexvaccaro,
Iām not sure I fully understand this sentence
The MSBuild step before integrating with SonarCloud took on avg 1.5 mins , after integration it takes over 13 mins
Do you mean that without Sonarcloud analysis, it takes 1.5min and with the Sonarcloud analysis, it takes 13 min? Are you talking about the āPrepare Analysis Configurationā build task?
This sounds very similar to a problem a team Iām supporting are experiencing. They have a solution with 4 c# projects. Similar setup to the above except these are .NetCore projects rather than .NetFramework. Without SonarCloud steps, the build process takes 16sec. With SonarCloud steps, the build process takes nearly 16 minutes. Looking through the build logs, most of the build time seems to be with one other projects in the solution only. Is there a way to understand why this may be the case?
Yes, with adding āPrepare Analysis Configurationā to my build the MSBuild task takes just over a minute, after adding the āPrepare Analysis Configurationā the same MSBuild task takes 13 mins on avg
Is that possible for you to share the Prepare analysis task log in debug mode ?
Can you check on your side that the bandwitch allocated to your Azure VM is sufficient ? By the way, in which location is it ? We donāt have any CDN, may it be a slowness on that side.
We are having a similar issue as well, however we are using Microsoft hosted-agents, so not able to affect the hardware profile or location. The point you made about CDN though, where is the Sonarcloud datacenter located? This maybe a factor for us.
Hi @Christophe_Havard@mickaelcaro - We are having the same problem with our project where adding SonarCloudPrepare step significantly increases the website build time from about 3 m to about 30 m. we are using Microsoft hosted-agents and Branch and Pull Request analysis.
When I checked website build step log saw these two errors this could be the issue ? SCM provider autodetection failed. Please use āsonar.scm.providerā to define SCM of your project, or disable the SCM Sensor in the project settings.
2020-10-10T11:41:10.0710604Z INFO: āsonar.coverage.jacoco.xmlReportPathsā is not defined. Using default locations: target/site/jacoco/jacoco.xml, target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
Could each of you gives us a background task id where the build takes a long amount of time ? So that we can try to see the hotspots on our internal logs.
You can go to the Administration -> Background tasks menu of your project on SonarCloud, you should be able to find one of those in the āIDā column.
I looked into your background task performance data and shared the data with @mickaelcaro and @Christophe_Havard. We are investigating.
By the way, the community support is not a paid support, we have zero support role in the team and no SLA. We do it with all other engineering activities we have to do on a daily basis. Would you please consider this to set your expectations? Thanks.
Overall Build take around 1h 21m while website build its own took around 42m - half of the entire build but if remove SonarcloudPrepare steps it only take 2-3 min