RedisDB 在尝试执行 flushdb 时抛出超时异常
RedisDB throws timeout exception when trying to execute flushdb
我对 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
好吧,我似乎以某种方式设法解决了问题,但还没有深入研究导致问题的原因。长话短说,增加 syncTimeout
似乎有所帮助,并且不再抛出异常。该线程对我的情况很有帮助 stackexchange.redis throws timeout even after increasing timeout?
我对 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
好吧,我似乎以某种方式设法解决了问题,但还没有深入研究导致问题的原因。长话短说,增加 syncTimeout
似乎有所帮助,并且不再抛出异常。该线程对我的情况很有帮助 stackexchange.redis throws timeout even after increasing timeout?