【问题标题】:RedisDB throws timeout exception when trying to execute flushdbRedisDB尝试执行flushdb时抛出超时异常
【发布时间】:2020-05-01 23:21:06
【问题描述】:

我对 StackExchange.Redis 有疑问。在我们的过程中,我们有两个 redis 数据库。这些数据库用于存储用户可以执行查找的类似信息,因此我们在导入时在它们之间切换,以便用户可以持续访问信息。每天大约有 50000000 条记录插入到一​​个数据库中,并从另一个数据库中删除旧记录,为第二天的导入做准备。记录以 100000 条记录为单位导入。我们面临的问题是数据导入完成后,Redis抛出异常,同时尝试执行flushdb命令。

StackExchange.Redis.RedisTimeoutException Timeout awaiting response (outbound=0KiB, inbound=0KiB, 5976ms elapsed, timeout is 5000ms), command=UNKNOWN, next: SELECT, inst: 0, qu: 0, qs: 2, aw: False, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, serverEndpoint: 127.0.0.1:6379, mgr: 10 of 10 available, clientName: MX-ENUM-VM, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=3,Free=32764,Min=2,Max=32767), v: 2.0.601.3402 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)    at Project.Synchronizer.Service.RedisHelper.FlushDb(Int32 dbIndex)
    at Project.Synchronizer.Service.RedisHelper.SelectAndClearRedisDbForNumberUpload()
    at Project.Synchronizer.Service.RedisHelper.UploadNumbers()
    at Project.Synchronizer.Service.DataUploadService.UploadNumbersToRedis() StackExchange.Redis.RedisTimeoutException: Timeout awaiting response (outbound=0KiB, inbound=0KiB, 5976ms elapsed, timeout is 5000ms), command=UNKNOWN, next: SELECT, inst: 0, qu: 0, qs: 2, aw: False, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, serverEndpoint: 127.0.0.1:6379, mgr: 10 of 10 available, clientName: CLIENT-ENUM-VM, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=3,Free=32764,Min=2,Max=32767), v: 2.0.601.3402 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
    at Project.Synchronizer.Service.RedisHelper.FlushDb(Int32 dbIndex)
    at Project.Synchronizer.Service.RedisHelper.SelectAndClearRedisDbForNumberUpload()
    at Project.Synchronizer.Service.RedisHelper.UploadNumbers()
    at Project.Synchronizer.Service.DataUploadService.UploadNumbersToRedis()

我尝试执行此命令的方式是

private async Task FlushDb(int dbIndex)
{
    await getDB(dbIndex).ExecuteAsync("flushdb");
}

任何形式的帮助都将不胜感激,因为我已经坚持了很长一段时间了。为了记录,我试图在这里得到一些答案,但无法弄清楚https://stackexchange.github.io/StackExchange.Redis/Timeouts.html

【问题讨论】:

    标签: c# asp.net .net redis stackexchange.redis


    【解决方案1】:

    好吧,我似乎设法以某种方式解决了这个问题,但还没有深入研究导致它的原因。长话短说,增加syncTimeout 似乎有所帮助,并且不再抛出异常。这个帖子对我来说很有帮助stackexchange.redis throws timeout even after increasing timeout?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-16
      相关资源
      最近更新 更多