Skip to content

gateway: limit the number of requests in flight #881

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

Open
lidel opened this issue Mar 11, 2025 · 0 comments
Open

gateway: limit the number of requests in flight #881

lidel opened this issue Mar 11, 2025 · 0 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/gateway Issues related to HTTP Gateway

Comments

@lidel
Copy link
Member

lidel commented Mar 11, 2025

Filling issue based on triage discussion today, cc @gammazero if below prior art context is useful

Currently, we have no "requests in flight" cap in boxo/gateway and require reverse proxy in front of go binary to enforce the limit.

Proposed improvement

There should be a built-in mechanism to limit the number of ongoing HTTP gateway requests in flight, and return HTTP 503 Service Unavailable with Retry-After when limit is reached.

Make it a config option, boxo/gateway should ship with some implicit default, protecting people who expose it blindly to the internet

Prior art

  • At public gateway,
    • the current ceiling exist at nginx and for our rainbow prod seems to be really high: worker_connections is set to 10240 (per each instance). For reference, nginx default is 512, raising to 1024 seems to be a sensible place to start as default, protecting from traffic spikes.
    • there is a timeout of 30 seconds (nginx's proxy_read_timeout) – we dont have built-in config yet, but its tracked in gateway: ability to set response write timeout #679
@lidel lidel added need/triage Needs initial labeling and prioritization kind/enhancement A net-new feature or improvement to an existing feature topic/gateway Issues related to HTTP Gateway labels Mar 11, 2025
@lidel lidel changed the title boxo/gateway: limit the number of requests in flight gateway: limit the number of requests in flight Mar 11, 2025
@gammazero gammazero added P2 Medium: Good to have, but can wait until someone steps up and removed need/triage Needs initial labeling and prioritization labels Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/gateway Issues related to HTTP Gateway
Projects
None yet
Development

No branches or pull requests

2 participants