allocate SocketAsyncEngine less frequenty to reduce the number of epoll_wait threads...
authorAdam Sitnik <adam.sitnik@gmail.com>
Wed, 5 Feb 2020 19:38:36 +0000 (20:38 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Feb 2020 19:38:36 +0000 (20:38 +0100)
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs

index f8224e8c89a22ae4778bd2427695972212eb092f..84f733c314cc329fba21564d18e926d8cadd2989 100644 (file)
@@ -105,7 +105,7 @@ namespace System.Net.Sockets
         //
         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