Page MenuHomePhabricator

RESTBase mentions 200 requests/s but varnishes rate limit at 50/seconds
Closed, DuplicatePublic

Description

The RESTBase API doc at http://restbase.wikimedia.org/fr.wikipedia.org/v1/?doc mentions:

As a general rule, don't perform more than 200 requests/s to

@BBlack recently introduced a rate limiter in Varnish which limits requests to 50/secs:

modules/varnish/templates/vcl/wikimedia.vcl.erb:

sub misspass_limiter {
    if (ipcast.ip(req.http.X-Client-IP, "127.0.0.1") !~ wikimedia_nets) {
        // TBF: "1, 0.02s, 250" == "50/s, burst of 250"
        if (!tbf.rate(req.http.X-Client-IP, 1, 0.02s, 250)) {
            error 429 "Request Rate Exceeded";
        }
    }
}

Maybe we should only mention the actual rate limit on the already linked page https://www.mediawiki.org/wiki/API_versioning then add a comment in VCL to remember folks to update the wikipage.

Event Timeline

hashar raised the priority of this task from to Low.
hashar updated the task description. (Show Details)
hashar added projects: RESTBase, Varnish.
hashar added subscribers: hashar, BBlack.