Skip to content
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

Establish NGINX-level rate limiting & client backoff #102

Open
masalim2 opened this issue Oct 29, 2021 · 2 comments
Open

Establish NGINX-level rate limiting & client backoff #102

masalim2 opened this issue Oct 29, 2021 · 2 comments
Labels
DevOps Streamlining testing, deployment, and reliable operation

Comments

@masalim2
Copy link
Contributor

NGINX offers the ideal point at which user-level rate limiting can be introduced. We may want to rate limit based on the HTTP Authorization header key (which will be unique to a user’s balsam login) rather than conventional source IP address, as that could be messed up by NAT in front of clusters.

Clients must be robust to throttling: the Python SDK already features exponential backoff and retry of timed-out connections or failed reads. We simply want to invoke the backoff when the client receives an HTTP 503 SLOW DOWN response! This keeps existing workloads robust to rate limiting: they will automatically slow down to wait their turn, rather than denying service for others.

@masalim2 masalim2 added the DevOps Streamlining testing, deployment, and reliable operation label Oct 29, 2021
@masalim2
Copy link
Contributor Author

As part of this change, let's move NGINX into the docker-compose stack instead of running it separately, as proposed in #81

@masalim2
Copy link
Contributor Author

masalim2 commented Nov 4, 2021

  • allow a burst of 32 requests with nodelay option; process 15 requests per second
  • balsam/client robust to HTTP 503 slow downs (backoff and retry)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps Streamlining testing, deployment, and reliable operation
Projects
None yet
Development

No branches or pull requests

1 participant