Skip to content

Conversation

gitsrc
Copy link
Contributor

@gitsrc gitsrc commented Mar 19, 2025

This commit introduces a mechanism to limit the number of concurrent in-flight HTTP requests to the gateway.

  • Implements a configurable limit for concurrent requests.
  • Returns HTTP 503 Service Unavailable with Retry-After header when the limit is reached.
  • Includes a default limit to protect against traffic spikes when exposed without a reverse proxy.

This change enhances gateway's resilience and prevents overload by limiting concurrent requests.

#881

gitsrc added 2 commits March 19, 2025 19:14
Signed-off-by: gitsrc <34047788+gitsrc@users.noreply.github.com>
Signed-off-by: gitsrc <34047788+gitsrc@users.noreply.github.com>
@gitsrc gitsrc requested review from lidel and a team as code owners March 19, 2025 11:30
@hsanjuan hsanjuan added the need/maintainers-input Needs input from the current maintainer(s) label Mar 25, 2025
@hsanjuan
Copy link
Contributor

Triage notes: this will be triaged as part Kubo v0.35 (@lidel )

@lidel
Copy link
Member

lidel commented May 6, 2025

Triage notes: moving to 0.36 0.37

@lidel lidel mentioned this pull request May 21, 2025
46 tasks
@hsanjuan hsanjuan marked this pull request as draft June 10, 2025 14:20
@hsanjuan
Copy link
Contributor

Triage notes: @lidel is still on it, has not forgotten about, will be dealt with in due time.

@lidel
Copy link
Member

lidel commented Aug 11, 2025

This endeavor needs more metrics and tests and integration with timeouts.

The atomic.AddInt32 proposed in this PR is ok, however feels like not the best tool for the job. Let's go with more idiomatic semaphore approach from #994 which has lower risk of busy-waiting/checking/mutating shared int value in a tight loop.

@lidel lidel closed this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/maintainers-input Needs input from the current maintainer(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants