From c9b7ec2af91792b9d6558875c2a44267ac0ac5a0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 9 Aug 2019 12:06:33 +0100 Subject: Make the DNS cache timeout configurable. In containerized environments, DNS is simulated. It can change several times per second as containers move around. The hardcoded timeout was too long for a container environment. --- OpenSim/Region/Application/Application.cs | 2 +- OpenSim/Region/Application/OpenSim.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index e4c3329..7c3b6c5 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -84,7 +84,7 @@ namespace OpenSim ServicePointManager.DefaultConnectionLimit = 12; } - try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } + try { ServicePointManager.DnsRefreshTimeout = 5000; } catch { } ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index fcc8717..ee4ddf4 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -37,6 +37,7 @@ using System.Runtime; using System.Text; using System.Text.RegularExpressions; using System.Timers; +using System.Net; using log4net; using NDesk.Options; using Nini.Config; @@ -119,6 +120,9 @@ namespace OpenSim stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 ); stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 25); m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) "); + + int dnsTimeout = startupConfig.GetInt("DnsTimeout", 30000); + try { ServicePointManager.DnsRefreshTimeout = dnsTimeout; } catch { } } if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) -- cgit v1.1