1

StackExchange.Redis.RedisTimeoutException: Timeout awaiting response (outbound=0KiB, inbound=4KiB, 6000ms elapsed, timeout is 3000ms), command=EXISTS, next: GET mykey, inst: 0, qu: 0, qs: 0, aw: True, bw: SpinningDown, rs: ReadAsync, ws: Writing, in: 993, last-in: 1, cur-in: 0, sync-ops: 37097, async-ops: 170733, serverEndpoint: XXXXXXXX, conn-sec: 5412.93, aoc: 1, mc: 1/1/0, mgr: 10 of 10 available, clientName: XXXXXXXXX, PerfCounterHelperkeyHashSlot: 7906, IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=28,Free=32739,Min=2,Max=32767), POOL: (Threads=28,QueuedItems=1715,CompletedItems=1310821,Timers=80), v: 2.6.122.38350 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

Could you please answer the following questions

  1. Why do I have sync-ops when I am not using sync functions anywhere in the code. I use the update and get as follows (asynchronous functions)-
private AsyncPolicyWrap GetPolicy()
{
    return Policy.WrapAsync(redisConnectionRetryPolicy, customRetryPolicy ?? defaultRedisTimeoutPolicy);
}

public async Task<RedisValue> StringGetAsync(RedisKey key)
{
    return await GetPolicy().ExecuteAsync(() => redis.StringGetAsync(key));
}

I am also using redLock to acquire the lock.

  1. I intend to use ThreadPool.SetMinThreads(10, minIOC) to change the number of minimum number of worker threads. I am using FARGATE ecs tasks- there are 4 tasks each with 2vCPUs and 16 GB RAM. And based on the behaviour, I intend to modify the value. Please let me know if I am missing anything here.

1 Answer 1

0
  1. I've checked, and that counter is definitely only incremented via the sync path, so something somewhere is doing it; I won't say for sure that this isn't internal to the library, but: my initial suspicion would be that you've missed a code path. I might add a toggle to disable sync operations completely, which would provide a way to find out
  2. why? what is your concern here? what problem or symptom are you trying to fix? A timeout doesn't mean "you don't have enough worker threads" - it just means that something in the end-to-end life-cycle a request: timed out. The first thing I'd look at would be SLOWLOG GET, or network. Client reactivation can be a factor, but with 28 busy, I wouldn't be immediately concerned about that (and if it was 2800 - which I see more often than you'd expect - adding a few more isn't going to help... the problem is that you have 2800; we report this number simply to help people identify possible factors - we aren't saying "you need more")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.