From 3086dcfc778cad7f5bae3b1419cbf27e35e9c18f Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Wed, 29 Jan 2020 18:19:42 +0100 Subject: [PATCH] allocate SocketAsyncEngine less frequenty to reduce the number of epoll_wait threads and get Plaintech TechEmpower benchmark RPS +5% --- .../src/System/Net/Sockets/SocketAsyncEngine.Unix.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs index f8224e8c89a22a..84f733c314cc32 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs @@ -105,7 +105,7 @@ public bool TryRegister(SafeSocketHandle socket, out Interop.Error error) // private static readonly IntPtr MaxHandles = IntPtr.Size == 4 ? (IntPtr)int.MaxValue : (IntPtr)long.MaxValue; #endif - private static readonly IntPtr MinHandlesForAdditionalEngine = s_engineCount == 1 ? MaxHandles : (IntPtr)32; + private static readonly IntPtr MinHandlesForAdditionalEngine = s_engineCount == 1 ? MaxHandles : (IntPtr)EventBufferCount; // // Sentinel handle value to identify events from the "shutdown pipe," used to signal an event loop to stop