Issue is that we are noticing heavy CPU usage, while running SonarScanner for MSBuild.It runs the VBCSCompiler process which uses all CPU.So when we run 2 parallel jobs, the server CPUs gets up to 100%.
Thanks. Can you share the specs of your machine and give us an idea of the size of the project? It’s not unusual for analysis to be intensive, especially on a large project. And if the underlying host is underpowered, what you’re seeing might be expected.
We have many applications, small and large ones…NET core applications for example have no trouble.We are noticing this issue only with .NET Framework apps.
Lines of code examples`
18569, 60-70%, .NET Framework v4.8
10144, 60-70%, .NET Framework v4.8
27,346, 90-100%, .NET Framework v4.8
57,605, 90-100%, .NET Framework v4.8
153,408, 100%, .NET Framework v4.8
Server parameters now`
RAM:12.0 GB
CPU: 4 sockets, 16 processors
Windows Edition: Windows Server 2019 Datacenter
This seems more like an MSBuild issue, especially since you are not encountering the same level of CPU usage on the newer .NET versions.
A suggestion would be to set nodeReuse to false in the MSBuild arguments during the build, to prevent any nodes from hanging during and after the build.
If that does not make the situation any better, you can consider raising this to the runtime or the MSBuild team.