Skip to content

Request Throttling for ASP.NET Core #29933

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

Closed
davidfowl opened this issue Feb 5, 2021 · 12 comments
Closed

Request Throttling for ASP.NET Core #29933

davidfowl opened this issue Feb 5, 2021 · 12 comments
Assignees
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares design-proposal This issue represents a design proposal for a different issue, linked in the description feature-rate-limit Work related to use of rate limit primitives

Comments

@davidfowl
Copy link
Member

Summary

1-2 sentences. Say what this is about.

Motivation and goals

1-2 paragraphs, or a bullet-pointed list. What existing pain points does this solve? What evidence shows it's valuable to solve this?

In scope

A list of major scenarios, perhaps in priority order.

Out of scope

Scenarios you explicitly want to exclude.

Risks / unknowns

How might developers misinterpret/misuse this? How might implementing it restrict us from other enhancements in the future? Also list any perf/security/correctness concerns.

Examples

Give brief examples of possible developer experiences (e.g., code they would write).

Don't be deeply concerned with how it would be implemented yet. Your examples could even be from other technology stacks.

@davidfowl davidfowl added the design-proposal This issue represents a design proposal for a different issue, linked in the description label Feb 5, 2021
@davidfowl davidfowl self-assigned this Feb 5, 2021
@Kahbazi
Copy link
Member

Kahbazi commented Feb 6, 2021

@davidfowl Do you accept PR for this? 😅 https://github.com/Kahbazi/ThrottlR

@davidfowl
Copy link
Member Author

davidfowl commented Feb 6, 2021

@Kahbazi based on the name alone, yes! But no, there's a bunch of design work that needs to happen. I'm sure the ideas are very similar though so maybe once I write down what has been done thus far the stars will align.

PS: The quick look I've given that repository, the feature set aligns with what I would want to support here as well. I'll flesh out the proposal so you can give feedback based on what you've done.

@BrennanConroy BrennanConroy added this to the Next sprint planning milestone Feb 8, 2021
@ghost
Copy link

ghost commented Feb 8, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@halter73
Copy link
Member

halter73 commented Feb 8, 2021

I hope this will subsume/replace Microsoft.AspNetCore.ConcurrencyLimiter. See #10702 for the original epic.

@davidfowl
Copy link
Member Author

I think if the abstraction is done right it might be able to replace the concurrency limiter

@halter73
Copy link
Member

halter73 commented Mar 3, 2021

I closed #19823 which asks for action-based (or endpoint routing based) concurrency limit support. I think this design should cover that by allowing for the implementation of hard concurrency limits and per-endpoint configuration.

@msschl
Copy link
Contributor

msschl commented May 17, 2021

@davidfowl Any news on this? Is it still on track for 6.0?

Will there be an IP based request throttling variant?

@ghost
Copy link

ghost commented Jul 14, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@JunTaoLuo JunTaoLuo removed their assignment Jul 30, 2021
@Tratcher Tratcher modified the milestones: Backlog, .NET 7 Planning Oct 28, 2021
@Tratcher Tratcher added the feature-rate-limit Work related to use of rate limit primitives label Oct 28, 2021
@compgumby
Copy link

I would love throttling on the Blazor virtualizer. The ItemsProvider is called with no regard for latency in that call. In my scenario, the items provider issues a database call which takes some time. Not a lot... but long enough such that a user could keep scrolling. As they do, the ItemsProvider calls just stack up. What I would prefer is all but the most recent data requests be discarded while a current fetch is underway. When the user finally stops scrolling, the most recent data request could then become the final request.

Obviously, it has to be configurable because different data sources behave differently - but right now, if a user gets impatient and continues to scroll, that ItemsProvider function gets hammered and the SQL calls just stack up. Because I'm returning the right items count for the universe of results, they can also drag the scroll bar into a position that seems "right", but there's a myriad of calls that get stacked up while they're doing it. It would be nice if we could simply ignore scroll events until they're done for .5 seconds (or something like that.)

@wtgodbe
Copy link
Member

wtgodbe commented Sep 14, 2022

@wtgodbe wtgodbe closed this as completed Sep 14, 2022
@compgumby
Copy link

@wtgodbe and @Tratcher - Thank you! I will give this a spin shortly. :)

@wtgodbe
Copy link
Member

wtgodbe commented Sep 14, 2022

Great! Here's a doc you can read to help you get started: https://docs.microsoft.com/en-us/aspnet/core/performance/rate-limit?view=aspnetcore-7.0, plus some info about updates in RC1 here: https://docs.microsoft.com/en-us/aspnet/core/performance/rate-limit?view=aspnetcore-7.0

@ghost ghost locked as resolved and limited conversation to collaborators Oct 14, 2022
@amcasey amcasey added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares label Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares design-proposal This issue represents a design proposal for a different issue, linked in the description feature-rate-limit Work related to use of rate limit primitives
Projects
None yet
Development

No branches or pull requests