New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout in Redis #1150
Comments
Could you please help as we are getting this error in production. |
We are also getting below error |
same problem. Timeout performing EXISTS (5000ms), next: EXISTS test:insert:herokillrecord, inst: 5, qu: 0, qs: 23, aw: False, rs: ReadAsync, ws: Idle, in: 3885, in-pipe: 0, out-pipe: 45, serverEndpoint: 192.168.1.161:6380, mgr: 9 of 10 available, clientName: 5f42773d6dc1, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=20,Free=32747,Min=4,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) |
we get the same issue,wait for help! |
Hi |
We are also having similar issues. |
85 > 8 and 100 > 8 |
20 > 4 |
same problem |
Has anyone try downgrading back to 1.2.6 ? |
I was planning to migrate to the latest version. Should I stop it? I was getting CPU Spikes using version 1.2.6 when we have high traffic and the reason was related to Socket Manger.WriteToAllQueue. We are dead in the water now? |
in 'xxx.runtimeconfig.json' file add |
i think StackExchange.Redis need warmup before handle high rate request. i tested 2.x(2.0.601 & 2.0.513) in docker using jmeter
Test Code
Setting of Test
if i start test just after i start docker container if i stop test and restart test. if i restart docker container and set Ramp-up Period to 100 if i stop test , set Ramp-up Period to 1 and wait for 20 min, then restart test. so ,i think StackExchange.Redis need warmup before handle high rate request. |
Same problem. |
What is the size of data, you are all trying to store? I have reduced my time outs by compressing the data, i store on Redis because your network pipe speed also matters. |
Fixed. Increased for the min size of minWorker and minIOC. |
Sorry, I'm have same problem. My case: Full exception:
|
ThreadPool.SetMinThreads(int workerThreads, int completionPortThreads); //100 or more |
I know about this, but I worry that Microsoft itself does not recommend setting arbitrary values.... |
Synopsis: "it is chewing through an inbound stream with 161 replies needed
and 61k of data to look at; the next reply expected is the reply to the GET
shown"
Now; this doesn't tell us everything, unfortunately; it could be that this
"GET" is a huge oversized blob that is causing the stall, or it could be
that something *earlier* caused a stall, and it is just trying to catch up
when it ran out of time. But: take a look at what that key holds to see
whether there's anything alarming. You should also look at the server-side
logs to see if the server is taking a long time to process anything; see
"SLOWLOG GET".
Ignore the "busy workers" - that shouldn't matter here.
…On Wed, 28 Aug 2019 at 19:18, Bullock ***@***.***> wrote:
As you can see, the number of the busy workers is greater than the minimum
value *7 > 2*. Could this be the cause of the error? How does this affect
the library? And what should I do to fix it?
ThreadPool.SetMinThreads(int workerThreads, int completionPortThreads); //100 or more
I know about this, but I worry that Microsoft itself does not recommend
setting arbitrary values....
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1150?email_source=notifications&email_token=AAAEHME2BKSHPS5I4DOOS33QG26OLA5CNFSM4HOLXHB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5MAQ2A#issuecomment-525863016>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAEHMHLX6XS2VGZJ56EKTDQG26OLANCNFSM4HOLXHBQ>
.
--
Regards,
Marc
|
Thanks for your reply. If I understand you correctly, the problem may be the size of the saved object? But all the objects that we save have a maximum size of 100 kilobytes |
Ok. But at a certain level of throughput, that might still be enough to
cause saturation issues on the pipe. We're investigating options for
providing concurrent independent pipes. I also can't know for sure, just on
this, whether this is indeed the cause. Stalls are very hard to pin down,
unfortunately. We need to be a little cautious as there's overheads in
adding more and more tracing to pinpoint it, that can then actively
contribute to *causing* the exact problem.
…On Wed, 28 Aug 2019, 19:37 Bullock, ***@***.***> wrote:
Synopsis: "it is chewing through an inbound stream with 161 replies needed
and 61k of data to look at; the next reply expected is the reply to the GET
shown" Now; this doesn't tell us everything, unfortunately; it could be
that this "GET" is a huge oversized blob that is causing the stall, or it
could be that something *earlier* caused a stall, and it is just trying
to catch up when it ran out of time. But: take a look at what that key
holds to see whether there's anything alarming. You should also look at the
server-side logs to see if the server is taking a long time to process
anything; see "SLOWLOG GET". Ignore the "busy workers" - that shouldn't
matter here.
… <#m_-8115909219667388450_>
On Wed, 28 Aug 2019 at 19:18, Bullock *@*.***> wrote: As you can see, the
number of the busy workers is greater than the minimum value *7 > 2*.
Could this be the cause of the error? How does this affect the library? And
what should I do to fix it? ThreadPool.SetMinThreads(int workerThreads, int
completionPortThreads); //100 or more I know about this, but I worry that
Microsoft itself does not recommend setting arbitrary values.... — You are
receiving this because you are subscribed to this thread. Reply to this
email directly, view it on GitHub <#1150
<#1150>?email_source=notifications&email_token=AAAEHME2BKSHPS5I4DOOS33QG26OLA5CNFSM4HOLXHB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5MAQ2A#issuecomment-525863016>,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAEHMHLX6XS2VGZJ56EKTDQG26OLANCNFSM4HOLXHBQ
.
-- Regards, Marc
Thanks for your reply. If I understand you correctly, the problem may be
the size of the saved object? But all the objects that we save have a
maximum size of 100 kilobytes
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1150?email_source=notifications&email_token=AAAEHMFBWQ3BMQCHWWHCV2DQG3AU3A5CNFSM4HOLXHB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5MCHUA#issuecomment-525870032>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAEHMGKB76MX7A2IWBCEALQG3AU3ANCNFSM4HOLXHBQ>
.
|
Did you ever get a response? I'm having timeout issues and seeing similar stats: "WORKER: (Busy=5,Free=8186,Min=2,Max=8191" I have a feeling this is being caused by queries the developers wrote are returning too much data, but I don't know how to prove it yet. |
Never really solved.. but i have determined that the naive examples often
cited thst create lots of groups and add people to groups is a bad idea..
as someone's browser connecting/disconnecting causes a lot of signalr redis
traffic as it re-sets up all the group memberships etc across all nodes.
I think the best appproach is to only have one group per user (that user's
user id) and whenever you need to send messages just use your other
database/cache to manage group memberships and send direct messages out to
all the appropriate users.
We not only send the absolute bare minimum data over signalr (e.g. entity
id that got updated) and the clients can go and refresh their current view
as needed over standard https ajax.
Also implement an exponential backoff algorithm on your clients, so they
don't take your servers down when you take a server out of your load
balancer and 000's of clients try to reconnect.. (and randomise those
reconnection delays )
…On Tue, 22 Oct 2019, 20:32 placidseven, ***@***.***> wrote:
should I do to f
Did you ever get a response? I'm having timeout issues and seeing similar
stats:
"WORKER: (Busy=5,Free=8186,Min=2,Max=8191"
I have a feeling this is being caused by queries the developers wrote are
returning too much data, but I don't know how to prove it yet.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1150?email_source=notifications&email_token=AJ2SWSLTOMO5OHAEOT5UTE3QP5BNJA5CNFSM4HOLXHB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB6X3LA#issuecomment-545095084>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ2SWSMSNQAJBK3MYTSNZYDQP5BNJANCNFSM4HOLXHBQ>
.
|
It is said that using all asynchronous methods can solve this problem. |
We're exploring a theory on a now-known cause and could use your help. For anyone experiencing issues on a .NET Framework application - are you in either of the following cases? .NET Framework Web ProjectsIn <add key="aspnet:UseTaskFriendlySynchronizationContext" value="false" /> or, something less than 4.5 in <httpRuntime targetFramework="4.x" /> .NET Framework Non-web ProjectsIn
To clarify: it doesn't matter what your If this matches anyone here, it'd be hugely helpful to know. @mgravell is working on a workaround for this scenario. |
Having the same intermittent timeout issues, using .NET Framework web project, however UseTaskFriendlySynchronizationContext is not explicitly set and the httpruntime isn't 4.x |
As mentioned by @drakefang I'm using Docker, that's the only commonality I can see in this thread. |
asp.net core 3.1 on ubuntu 16.0.4: test script: |
https://stackexchange.github.io/StackExchange.Redis/ThreadTheft |
i think isn’t the reason.
result: (only 1 cpu)
|
i had found the answer: dotnet/aspnetcore#17090 (comment) |
Just to chime in here. Same issue as above, also running in docker. I this instance the client and redis server are on same physical machine! physical machine cpu circa 4% StackExchange.Redis.RedisTimeoutException: Timeout performing RPOP (5000ms), next: RPOP TradeReplicatorMessage, inst: 0, qu: 0, qs: 1, aw: False, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, serverEndpoint: 172.16.6.20:6379, mc: 1/1/0, mgr: 10 of 10 available, clientName: ln-tcmp2, IOCP: (Busy=0,Free=1000,Min=24,Max=1000), WORKER: (Busy=6,Free=32761,Min=24,Max=32767), v: 2.1.30.38891 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) |
One or more errors occurred. (Timeout performing HGETALL (5000ms), inst: 0, qu: 0, qs: 4, aw: False, rs: ComputeResult, ws: Idle, in: 0, in-pipe: 127930169, out-pipe: 0, serverEndpoint: 192.168.1.61:6379, mgr: 8 of 10 available, clientName: WIN-2NDF9JN0529, IOCP: (Busy=1,Free=999,Min=4,Max=1000), WORKER: (Busy=1,Free=32766,Min=4,Max=32767), v: 2.0.600.65315 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)) |
Any updates on this? We are experiencing the same error in production, using version 2.0.600.65315 |
For anyone hitting this, please try the latest release as we added more debugging information to the exceptions in 2.2.x - we're working more on stability with the cloud folks now (for scenarios we don't generally see, but do want to solve). @Xiaobaicoder-pixel For your case, it looks like you're pulling back a few keys totalling 128MB, that's quite a bit of data and depending on your bandwidth, a higher timeout is likely needed. @RanderGabriel please try the latest 2.2.x release! |
Update on the above: the stability improvements (especially on connecting and re-connecting) that we've been working on are now on NuGet, in version 2.2.50. |
Thanks for the update Nick. |
@mataness You can see the PR numbers in the release notes. The basics are we found some races in connections and reconnections under certain circumstances and worked to generally fix the ordering problem. I'm not trying to be vague about circumstances, they're just really numerous...it's the speed and race by latency, thread pool, etc. that could cause it - there was no specific setup to use as an example. It was (by nature) more likely in higher latency environments in general, though. |
Anyone tested with the latest version if this still issue or not we are having the same issue.
|
It is, sadly, very hard to say with certainty that a library update will
fix your timeout, because when a timeout occurs, all we know is what
*didn't* happen - your timeout could have been a genuine server or network
blip, or your client node could have been overwhelmed. But it is definitely
worth trying, because another possibility is that it was a connection
stability issue that is now improved.
…On Thu, 1 Jul 2021, 18:23 Jinesh Patel, ***@***.***> wrote:
Anyone tested with the latest version if this still issue or not we are
having the same issue.
Exception : StackExchange.Redis.RedisTimeoutException: Timeout performing
EXISTS (5000ms), next: EXISTS
e85ef8ed-f047-48dd-a7dc-9003f9be07farelease-l-beta.ancileuperform.comAccountCreateden-US,
inst: 1, qu: 0, qs: 7, aw: False, rs: ReadAsync, ws: Idle, in: 231,
serverEndpoint:
master.elr1ig6kxl5p1gvi.lm2pze.use1.cache.amazonaws.com:6379, mc: 1/1/0,
mgr: 10 of 10 available, clientName: 169, IOCP:
(Busy=0,Free=1000,Min=2,Max=1000), WORKER:
(Busy=7,Free=32760,Min=2,Max=32767), v: 2.1.30.38891 (Please take a look at
this article for some common client-side issues that can cause timeouts:
https://stackexchange.github.io/StackExchange.Redis/Timeouts)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1150 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEHMHDVYBMC7WEB2W6HKLTVSQBZANCNFSM4HOLXHBQ>
.
|
Okay, We updated our readis size to t2.Medium so we have more resources to respond to the requested this happens when it's running code in the Parallels and trying to fetch data from the cache.
Waiting for tasks after that. Not sure if there is anything wrong I am doing here. I will try to update and see if that fixes it or not |
That code doesn't show a single library usage, so: I can only speculate, but: it looks like you're spawning a bunch of tasks (presumably quite a big number), each of which is appears to us the synchronous API surface. That would be a good way to block your own thread-pool and hammer a server. Since redis server is a beast, I'd expect the thread-pool to lock up first. Suggestions:
But: we're not a psychic debugging service; we can't comment much on code we can't see. |
Curious what does "mc: 1/1/0" mean? It is not included in https://github.com/StackExchange/StackExchange.Redis/blob/main/docs/Timeouts.md. |
Any update on this issue? I'm seeing this on my aspnetcore service running on azure. It seems to correspond to load, but the actual worker/thread counts on our redis and web instances show them as having a ton of unused capacity. The error we're getting is the same as the ones mentioned, and we're on StackExchange 2.2.50 |
2 years ago I wrote a NuGet that adds connection pool abstraction on top of the Redis connection multiplexer. |
Since a lot of these timeouts are environment specific and we do our best to help, issues that are a conglomerate of many and a myriad of different causes unfortunately turn into a bit of a support mess over time. I'm going to close this one out as I think the people having issues here are resolved, but people experiencing timeouts today are much better off opening a new issue (if the timeouts documentation doesn't help already) with their specific error message (which we've improved many times over the releases) allowing us to help with advice much better. If anyone here is still having an issue on latest, please respond and let me know with a current error message! |
We are getting below errors after updating the StackExchange version to 2.0.601.
Could you please check.
Exception=StackExchange.Redis.RedisTimeoutException: Timeout performing GET (10000ms), next: PING, inst: 0, qu: 0, qs: 3, aw: False, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, serverEndpoint: Unspecified/:6379, mgr: 10 of 10 available, clientName: , IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=1,Free=2046,Min=2,Max=2047), 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 StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor
1 processor, ServerEndPoint server) at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor
1 processor, ServerEndPoint server)at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags)
The text was updated successfully, but these errors were encountered: