Severity: Info
File: src/Servy.Core/Services/ServiceManager.cs, line 886
Description:
GetAllServices uses Parallel.ForEach with MaxDegreeOfParallelism = Environment.ProcessorCount. On a 64-core server, this spawns 64 concurrent P/Invoke threads making OpenService calls against the SCM simultaneously.
The ExecuteBulkOperationAsync in the Manager already caps at Math.Min(Environment.ProcessorCount * 2, 8). The GetAllServices parallelism should have a similar cap.
Suggested fix:
Cap MaxDegreeOfParallelism at 8–16 regardless of core count, consistent with the bulk operation pattern.
Severity: Info
File:
src/Servy.Core/Services/ServiceManager.cs, line 886Description:
GetAllServicesusesParallel.ForEachwithMaxDegreeOfParallelism = Environment.ProcessorCount. On a 64-core server, this spawns 64 concurrent P/Invoke threads makingOpenServicecalls against the SCM simultaneously.The
ExecuteBulkOperationAsyncin the Manager already caps atMath.Min(Environment.ProcessorCount * 2, 8). TheGetAllServicesparallelism should have a similar cap.Suggested fix:
Cap
MaxDegreeOfParallelismat 8–16 regardless of core count, consistent with the bulk operation pattern.