生产环境在Azure上,使用Redis Cache Standard 2.5GB
。
示例1
System.Web.HttpUnhandledException (0x80004005): 抛出类型为'System.Web.HttpUnhandledException'的异常。---> StackExchange.Redis.RedisTimeoutException: 执行SETNX User.313123时超时,inst: 49, mgr: Inactive, err: never, queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, clientName: PRD-VM-WEB-2, serverEndpoint: Unspecified/Construct3.redis.cache.windows.net:6380, keyHashSlot: 15649, IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=1,Free=32766,Min=1,Max=32767)(请查看此文章,了解可能导致超时的常见客户端问题: http://stackexchange.github.io/StackExchange.Redis/Timeouts) StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor
1 processor, ServerEndPoint server) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 2120 at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor
1 processor, ServerEndPoint server) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\RedisBase.cs:line 81
示例2
StackExchange.Redis.RedisTimeoutException: 在执行GET ForumTopic.33831操作时超时,实例:1,管理器:未激活,错误:从未出现,队列:2,输入/输出完成端口(IOCP):(繁忙=0,空闲=1000,最小=1,最大=1000),工作线程(WORKER):(繁忙=1,空闲=32766,最小=1,最大=32767),客户端名称:PRD-VM-WEB-2,服务器端点:Unspecified/Construct3.redis.cache.windows.net:6380,键哈希插槽:5851。(请参阅此文章,查看一些可能导致超时的常见客户端问题:http://stackexchange.github.io/StackExchange.Redis/Timeouts) 在 StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) 中,文件路径为 c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs 的第 2120 行。 在 StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) 中,文件路径为 c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\RedisBase.cs 的第 81 行。 在 StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags) 中,文件路径为 c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs 的第 1647 行。 在 C3.Code.Controls.Application.Caching.Distributed.DistributedCacheController.Get[T](String cacheKey) 中,文件路径为 C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Distributed\DistributedCacheController.cs 的第 115 行。 在 C3.Code.Controls.Application.Caching.Manager.Manager.Get[T](String key, Func`1 getFromExternFunction, Boolean skipLocalCaches) 中,文件路径为 C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Manager\Manager.cs 的第 159 行。 在 C3.PageControls.Forums.TopicRender.Page_Load(Object sender, EventArgs e) 中,文件路径为 C:\Construct.net\Source\C3Alpha2\PageControls\Forums\TopicRender.ascx.cs 的第 40 行。 在 System.Web.UI.Control.OnLoad(EventArgs e)。 在 System.Web.UI.Control.LoadRecursive()。 在 System.Web.UI.Control.LoadRecursive()。 在 System.Web.UI.Control.LoadRecursive()。 在 System.Web.UI.Control.LoadRecursive()。 在 System.Web.UI.Control.LoadRecursive()。 在 System.Web.UI.Control.LoadRecursive()。 在 System.Web.UI.Control.LoadRecursive()。 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)。这些错误是零星的,每天会出现几次。
这是 Azure 网络故障,还是我可以减少的问题?从错误中的数字来看,似乎没有什么异常,而且服务器负载似乎从未超过 Azure 报告的 7%。
Redis 连接
internal static class RedisController
{
private static readonly object GetConnectionLock = new object();
public static ConnectionMultiplexer GetConnection()
{
if (Global.RedisConnection == null)
{
lock (GetConnectionLock)
{
if (Global.RedisConnection == null)
{
Global.RedisConnection = ConnectionMultiplexer.Connect(
Settings.Deployment.RedisConnectionString);
}
}
}
return Global.RedisConnection;
}
xxxxxxx.redis.cache.windows.net:6380,password=xxxxxx=,ssl=True,abortConnect=False,allowAdmin=True
我们在Azure上运行两个使用Redis的VM的Web应用程序。我们正在使用StackExchange.Redis 2.0.513非常感谢任何帮助,我们在这里已经快要崩溃了。我们已经从默认值更改了Application_Start ThreadPool.SetMinThreads(10, 10)
,但似乎没有任何区别。 - Tom Gullen