Skip to content

Commit a007656

Browse files
author
Koundinya Veluri
committed
Update comment, simplify calculation
1 parent 31afef5 commit a007656

File tree

1 file changed

+4
-1
lines changed
  • src/Servers/Kestrel/Transport.Sockets/src/Internal

1 file changed

+4
-1
lines changed

src/Servers/Kestrel/Transport.Sockets/src/Internal/IOQueue.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,16 @@ private static int DetermineDefaultCount()
8181
// Since each IOQueue schedules one work item to process its work, the number of IOQueues determines the maximum
8282
// parallelism of processing work queued to IOQueues. The default number below is based on the processor count and tries
8383
// to use a high-enough number for that to not be a significant limiting factor for throughput.
84+
//
85+
// On Windows, the default number is limited due to some other perf issues. Once those are fixed, the same heuristic
86+
// could apply there as well.
8487

8588
int processorCount = Environment.ProcessorCount;
8689
if (OperatingSystem.IsWindows() || processorCount <= 32)
8790
{
8891
return Math.Min(processorCount, 16);
8992
}
9093

91-
return (processorCount + 1) / 2;
94+
return processorCount / 2;
9295
}
9396
}

0 commit comments

Comments
 (0)