简体   繁体   中英

RedisDB throws timeout exception when trying to execute flushdb

I have a problem with StackExchange.Redis. In our process we have two redis databases. These databases are used to store similar information which the user can execute lookup onto, so we are switching between them on imports, so the user can continuosly access the information. Everyday around 50000000 records are inserted to one database and old records are deleted from the other, to prepare it for next day's import. The records are imported in batches of 100000 records. The problem we are facing is that after the data import has completed, Redis throws an exception, while trying to execute flushdb command.

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()

The way I try to execute this command is

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

Any kind of help would be greatly appreciated, because I am stuck on this for quite a while now. For the record, I was trying to get some answers here, but couldn't figure anything out https://stackexchange.github.io/StackExchange.Redis/Timeouts.html

Well, It seems that I somehow managed to solve the problem, but haven't delved too deep to what causes it. Long story short increasing syncTimeout seemed to help and the exception is no longer thrown. This thread was helpful in my case stackexchange.redis throws timeout even after increasing timeout?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM