Rowan Bohde c57304ac3f Add middleware for request prioritization (#33951)
This adds a middleware for overload protection that is intended to help protect against malicious scrapers.
It does this via [`codel`](https://github.com/bohde/codel), which will perform the following:

1. Limit the number of in-flight requests to some user-defined max
2. When in-flight requests have reached their begin queuing requests.
    Logged-in requests having priority above logged-out requests
3. Once a request has been queued for too long,
    it has a probabilistic chance to be rejected based on how overloaded the entire system is.

When a server experiences more traffic than it can handle,
this keeps latency low for logged-in users and rejects just
enough requests from logged-out users to not overload the service.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2025-04-14 16:25:48 +02:00
..
2023-12-19 09:29:05 +00:00
2025-03-31 01:53:48 -04:00
2023-07-04 18:36:08 +00:00
2025-03-31 01:53:48 -04:00
2024-05-03 09:13:48 +00:00
2025-01-03 00:32:02 +08:00
2025-03-31 01:53:48 -04:00
2023-06-18 16:10:44 +00:00
2023-10-10 18:47:49 +08:00
2025-03-24 03:53:30 +00:00
2023-02-20 16:18:26 -06:00