0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 18:09:26 +08:00
discourse/spec/integrity
Alan Guo Xiang Tan 9c781af9d1
PERF: Reject anonymous requests with 503 upon aggressive queuing (#36519)
This commit adds a default protection to all Discourse app which will
turn away all anonymous requests that has queued for more than the
duration configured
by the `reject_anonymous_min_queue_seconds` global setting, 1 second
by default. A queue time of 1 second is a sign that the app is very
overloaded so we are opting to turn away anonymous requests when that
happens.

While there may be better solutions like introducing an adaptive
concurrency limit somewhere in the stack, we like this solution for its
simplicity. We may consider the more complex solutions in the future but
the time is not now.

Other significant changes in this commit:

1. Moved setting of the `REQUEST_QUEUE_SECONDS` key in `env` to
   `Middleware::ProcessingRequest`.
2. Introduction of the `reject_anonymous_min_queue_seconds` global
   Setting.
2025-12-18 10:23:42 +08:00
..
coding_style_spec.rb DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
common_mark_spec.rb A11Y: add aria-label to automatically generated heading anchor links in posts (#36232) 2025-11-25 18:29:20 -05:00
having_multiple_tagged_loggers_spec.rb DEV: Add spec to ensure app works with multiple tagged loggers 2024-08-13 18:10:03 +02:00
i18n_spec.rb DEV: Check existence of wizard_js only in client.en.yml (#36349) 2025-12-01 14:46:59 +01:00
js_constants_spec.rb DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
middleware_order_spec.rb PERF: Reject anonymous requests with 503 upon aggressive queuing (#36519) 2025-12-18 10:23:42 +08:00
oj_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
onceoff_integrity_spec.rb PERF: Avoid using ObjectSpace.each_object in Jobs::Onceoff.enqueue_all (#28072) 2024-07-25 13:30:56 +08:00
site_setting_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00