Reputation: 41
This might be a bit of a weird question, but I'd like to make MSBuild slower.
At work I have the problem of having a rather slow project (compile time around 15 minutes) and currently only having one node on Jenkins that builds the project.
I am now trying to figure out how to use our own working machines as additional nodes if we so choose. My problem is now, that if I run MSBuild on the project, it uses every core of the CPU at 100%, which makes my system quite unusable during that time. I'd like to throttle MSBuild a bit to not use every core to its fullest. Is that possible? There is the switch "/maxcpucount[:numberOfProcessors]", but even if I use it I don't see any difference in CPU usage.
Can anybody help me here?
Screenshot of CPU usage with /maxcpucount:1
Upvotes: 1
Views: 1672
Reputation: 41
Okay. Finally found the correct phrase for searching and found https://developercommunity.visualstudio.com/idea/436208/limit-cpu-usage-of-visual-studio.html
Apparently there is now a switch in MSBuild, which sets the thread priority to low (-low). It still uses 100%, but the PC is at least usable. And through some environment variables it seems possible to limit the number of processors used, but that seems to be experimental still.
Also after much looking around I found this: Pass /MP option to the compiler using MSBuild Where the option /p:CL_MPCount=2 is used.
Upvotes: 3