Skip to content

feat: add more rate limit control flags #5570

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

Merged
merged 6 commits into from
Jan 5, 2023

Conversation

deansheather
Copy link
Member

@deansheather deansheather commented Jan 4, 2023

Adds --dangerous-disable-rate-limits flag to entirely disable rate limits globally.

Also:

  • Adds DeploymentConfigField[].EnvOverride because I moved the value in the deployment config struct and the name got changed.
  • Changes str.replaceAll to str.replace to fix node version differences causing swagger generation to fail in dogfood

Closes #5531

@deansheather deansheather requested review from ammario and bpmct January 4, 2023 14:44
Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Related, but semi off-topic: Should coder scaletest recommend people set --dangerous-disable-rate-limits if there is a rate limit error, or should we recommend most people scale test with concurrency=1? I ran into rate limits at the 60 user mark.

Regardless, I'll certainly document the flag in the scaling docs. The doc will also recommend scale testing on a staging deployment versus the prod one (where it would be dangerous to disable all rate limits on all occasions)

@deansheather deansheather requested a review from f0ssel January 4, 2023 16:03
@deansheather
Copy link
Member Author

Rate limits at low concurrency don't produce much load so I don't think we should recommend that. I think recommending this flag + using a staging deployment is OK. If customers really want to test on prod they'll most likely have to disable rate limits temporarily while they run their tests.

@ammario
Copy link
Member

ammario commented Jan 4, 2023

Can we just add a single disable rate limit flag? Three seems excessive for this narrow use case.

@deansheather
Copy link
Member Author

deansheather commented Jan 5, 2023

We already have a flag to configure the API rate limit, so I think we should expose flags for configuring the other rate limits as well. Right now they are magic numbers in the code.

Edit: I've removed the new flags in favor of just the disable flag.

@deansheather deansheather requested a review from a team as a code owner January 5, 2023 17:38
@deansheather deansheather requested review from BrunoQuaresma and mtojek and removed request for a team January 5, 2023 17:38
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FE looks good to me

@deansheather deansheather enabled auto-merge (squash) January 5, 2023 18:04
@deansheather deansheather merged commit 5a968e2 into main Jan 5, 2023
@deansheather deansheather deleted the dean/more-rate-limit-flags branch January 5, 2023 18:05
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scaletest: How can I avoid API rate limits?
5 participants