gpt4 book ai didi

azure - StackExchange.Redis 超时

转载 作者:IT王子 更新时间:2023-10-29 05:55:05 34 4
gpt4 key购买 nike

生产环境位于 Azure 上,使用 Redis 缓存标准 2.5GB

示例 1

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> StackExchange.Redis.RedisTimeoutException: Timeout performing 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) (Please take a look at this article for some common client-side issues that can cause timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts) at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor1 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: Timeout performing GET ForumTopic.33831, inst: 1, mgr: Inactive, err: never, queue: 2, qu: 0, qs: 2, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, clientName: PRD-VM-WEB-2, serverEndpoint: Unspecified/Construct3.redis.cache.windows.net:6380, keyHashSlot: 5851, IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=1,Free=32766,Min=1,Max=32767) (Please take a look at this article for some common client-side issues that can cause timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts) at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor1 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 at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs:line 1647 at C3.Code.Controls.Application.Caching.Distributed.DistributedCacheController.Get[T](String cacheKey) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Distributed\DistributedCacheController.cs:line 115 at C3.Code.Controls.Application.Caching.Manager.Manager.Get[T](String key, Func`1 getFromExternFunction, Boolean skipLocalCaches) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Manager\Manager.cs:line 159 at C3.PageControls.Forums.TopicRender.Page_Load(Object sender, EventArgs e) in C:\Construct.net\Source\C3Alpha2\PageControls\Forums\TopicRender.ascx.cs:line 40 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at 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;
}

最佳答案

有 3 种情况可能导致超时,但很难知道是哪一种情况:

  1. 图书馆被绊倒了;特别是,存在与 TLS 实现以及我们如何处理 v1.* 版本库中的读取循环相关的已知问题 - 我们在 v2 上投入了大量时间来解决这些问题。 *(但是:更新到 v2 并不总是那么简单,尤其是当您将该库用作依赖于特定版本的其他代码的一部分时)
  2. 服务器/网络发生故障;这是一个非常现实的可能性 - 如果它是服务器端的,查看“slowlog”会有所帮助,但我对此没有任何可见性
  3. 服务器和网络都很好,库正在尽其所能,但是客户端和服务器之间有一些巨大的 Blob 在延迟其他操作;这是我正在做出的改变,以帮助识别现在,如果这表明自己是一个常见问题,我们也许会考虑更好地利用并发连接(这并不增加带宽,但可以减少被阻止操作的延迟) - 这将是仅 v2 的更改,请注意

关于azure - StackExchange.Redis 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51651796/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com