-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Description
Description
The current documentation does include a very brief statement with regard to rate limiters and queuing, i.e.:
With queuing enabled, when a request exceeds the rate limit, it's placed in a queue where the request waits until a permit becomes available or until a timeout occurs.
While testing a fixed window rate limiter with a .QueueLimit > 0, requests indeed "wait" (seem to hang) until a permit becomes available as stated, but what about the "timeout" being mentioned? I assumed the timeout refers to the HTTP request timeout, which is configured either at a server level or on the actual endpoint, for example, by specifing: .WithRequestTimeout(TimeSpan.FromSeconds(4));, (if using builder.Services.AddRequestTimeouts(); / app.UseRequestTimeouts(); )
However, while testing, requests (with a QueueLimit > 0) never seem to timeout, they just seem to "wait" until the rate limiter window resets even if .WithRequestTimeout(); is added to the endpoint. I would have expected an HttpContext.RequestAborted to be triggered if the request times out (before the rate limiter window resets?), but such timeouts never seem to occur - hence my request for additional details.
If an example of a "timeout" event could be added when queuing is enabled, that would be appreciated.
Thanks in advance.
Page URL
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/performance/rate-limit.md
Document ID
bb96b20f-0991-d6de-4d98-192cd469460f
Platform Id
a32d8e13-92af-9a53-cfa1-45862b1df67c
Article author
Metadata
- ID: bb96b20f-0991-d6de-4d98-192cd469460f
- PlatformId: a32d8e13-92af-9a53-cfa1-45862b1df67c
- Service: aspnet-core
- Sub-service: performance