Production environment is on Azure, using Redis Cache Standard 2.5GB
.
Example 1
System.Web.HttpUnhandledException (0
As a best practice make sure you are using the following pattern to connect to the StackExchange Redis client:
private static Lazy lazyConnection = new Lazy(() => {
return ConnectionMultiplexer.Connect("cachename.redis.cache.windows.net,ssl=true,abortConnect=false,password=password");
});
public static ConnectionMultiplexer Connection {
get {
return lazyConnection.Value;
}
}
If the above does not work, there are some more debugging routes described in Source 1, regarding region, bandwidth and NuGet package versions among others.
Another option could be to increase the minimum IO threads. It’s often recommend to set the minimum configuration value for IOCP and WORKER threads to something larger than the default value. There is no one-size-fits-all guidance on what this value should be because the right value for one application will be too high/low for another application. A good starting place is 200 or 300, then test and tweak as needed.
How to configure this setting:
minIoThreads
configuration setting under the autoConfig="false"
and overriding the value is enough:
Important Note: the value specified in this configuration element is a per-core setting. For example, if you have a 4 core machine and want your minIOThreads setting to be 200 at runtime, you would use
.
ThreadPool.SetMinThreads()
method as described above.