Skip to content

scaletest: How can I avoid API rate limits? #5531

Closed
@bpmct

Description

@bpmct

I'm attempting to run a scale test on my Kubernetes cluster with the following command:

coder scaletest create-workspaces \
    --count 1000 \
    --template "kubernetes" \
    --concurrency 0 \
    --cleanup-concurrency 0 \
    --parameter "home_disk_size=10" \
    --run-command "sleep 2 && echo hello"

However, I'm only able to create roughly ~60 concurrent workspaces as I run into a rate limit error:

== FAIL: workspacebuild/794

        Error: login as new user: POST http://coder.example.com/api/v2/users/login: unexpected status code 429: You've been rate limited for sending more than 60 requests in 1m0s.

I have also set CODER_API_RATE_LIMIT=-1 for my coder server, but saw that some routes are still rate limited, regardless of this value:

  --api-rate-limit int                           Maximum number of requests per minute
                                                 allowed to the API per user, or per IP
                                                 address for unauthenticated users.
                                                 Negative values mean no rate limit. Some
                                                 API endpoints are always rate limited
                                                 regardless of this value to prevent
                                                 denial-of-service attacks.
                                                 Consumes $CODER_API_RATE_LIMIT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions