mirror of
https://github.com/discourse/discourse.git
synced 2025-09-10 08:38:11 +08:00
PERF: introduce aggressive rate limiting for anonymous (#11129)
Previous to this change our anonymous rate limits acted as a throttle. New implementation means we now also consider rate limited requests towards the limit. This means that if an anonymous user is hammering the server it will not be able to get any requests through until it subsides with traffic.
This commit is contained in:
parent
6490fac881
commit
2686d14b9a
3 changed files with 90 additions and 6 deletions
|
@ -241,7 +241,8 @@ class Middleware::RequestTracker
|
|||
"global_ip_limit_10_#{ip}",
|
||||
GlobalSetting.max_reqs_per_ip_per_10_seconds,
|
||||
10,
|
||||
global: true
|
||||
global: true,
|
||||
aggressive: true
|
||||
)
|
||||
|
||||
limiter60 = RateLimiter.new(
|
||||
|
@ -249,7 +250,8 @@ class Middleware::RequestTracker
|
|||
"global_ip_limit_60_#{ip}",
|
||||
GlobalSetting.max_reqs_per_ip_per_minute,
|
||||
60,
|
||||
global: true
|
||||
global: true,
|
||||
aggressive: true
|
||||
)
|
||||
|
||||
limiter_assets10 = RateLimiter.new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue