From 650e6bbe55c55fe05c9abe9d66f01e30aab3ea1e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 7 Sep 2020 18:08:20 +0100 Subject: [PATCH] try reduce number of this webrequest will keep alive anf gc will possible forget to release. this higher numbers should be only relative to robuts, generic connectiosn should have a lot less. But hard to control on current code --- OpenSim/Region/Application/Application.cs | 6 +++--- OpenSim/Server/ServerMain.cs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index d2163e1895..14fe7c0f5a 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -71,13 +71,13 @@ namespace OpenSim public static void Main(string[] args) { // First line, hook the appdomain to the crash reporter - AppDomain.CurrentDomain.UnhandledException += - new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); + AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Culture.SetCurrentCulture(); Culture.SetDefaultCurrentCulture(); - ServicePointManager.DefaultConnectionLimit = 64; + ServicePointManager.DefaultConnectionLimit = 32; + ServicePointManager.MaxServicePointIdleTime = 30000; try { ServicePointManager.DnsRefreshTimeout = 5000; } catch { } ServicePointManager.Expect100Continue = false; diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index 56ac55defd..fffedae5ca 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs @@ -80,7 +80,9 @@ namespace OpenSim.Server Culture.SetCurrentCulture(); Culture.SetDefaultCurrentCulture(); - ServicePointManager.DefaultConnectionLimit = 64; + ServicePointManager.DefaultConnectionLimit = 32; + ServicePointManager.MaxServicePointIdleTime = 30000; + ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;