浏览代码

Adjust worker threads (#10352)

* Adjust worker threads

* Bump unhinged to 9.0.7
Diogo Martins 3 周之前
父节点
当前提交
578ba1353a

+ 1 - 1
frameworks/CSharp/wiredio/UnhGHttp/Program.cs

@@ -12,7 +12,7 @@ internal class Program
     {
     {
         var builder = UnhingedEngine
         var builder = UnhingedEngine
             .CreateBuilder()
             .CreateBuilder()
-            .SetNWorkersSolver(() => Environment.ProcessorCount / 2)
+            .SetNWorkersSolver(() => Environment.ProcessorCount)
             .SetBacklog(16384)
             .SetBacklog(16384)
             .SetMaxEventsPerWake(512)
             .SetMaxEventsPerWake(512)
             .SetMaxNumberConnectionsPerWorker(512)
             .SetMaxNumberConnectionsPerWorker(512)

+ 1 - 1
frameworks/CSharp/wiredio/src/Platform/Platform.csproj

@@ -20,6 +20,6 @@
     </ItemGroup>
     </ItemGroup>
 
 
     <ItemGroup>
     <ItemGroup>
-      <PackageReference Include="Unhinged" Version="9.0.6" />
+      <PackageReference Include="Unhinged" Version="9.0.7" />
     </ItemGroup>
     </ItemGroup>
 </Project>
 </Project>

+ 1 - 1
frameworks/CSharp/wiredio/src/Platform/Program.cs

@@ -39,7 +39,7 @@ internal static class Program
             // It's the number of real cpu cores not cpu threads
             // It's the number of real cpu cores not cpu threads
             // This can improve the cache hits on L1/L2 since only one thread
             // This can improve the cache hits on L1/L2 since only one thread
             // is running per cpu core.
             // is running per cpu core.
-            .SetNWorkersSolver(() => Environment.ProcessorCount / 2)  
+            .SetNWorkersSolver(() => Environment.ProcessorCount - 2)  
             
             
             // Accept up to 16384 connections
             // Accept up to 16384 connections
             .SetBacklog(16384) 
             .SetBacklog(16384)