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

Rate limit not configured as expected in Kraken 2 #451

Closed
alexanderwink opened this issue Apr 1, 2022 · 3 comments · Fixed by #452
Closed

Rate limit not configured as expected in Kraken 2 #451

alexanderwink opened this issue Apr 1, 2022 · 3 comments · Fixed by #452
Labels

Comments

@alexanderwink
Copy link

Kraken 2

Rate limit has no effect

The extra_config for endpoint rate limiting does not work when adding qos/ratelimit/router. Adding github.com/devopsfaith/krakend-ratelimit/juju/router works however but the documentation is pretty clear that for 2.0 I'm supposed to use qos/ratelimit/router while juju is for 1.4.

Configuration file

{
  "$schema": "https://www.krakend.io/schema/v3.json",
  "version": 3,
  "endpoints": [{
    "backend": [{
      "host": [
        "http://service-xxxxxx.svc"
      ],
      "url_pattern": "/api/v1/xxxxxx"
    }],
    "endpoint": "/xxxxxx/api/v1/yyyyyy",
    "input_query_strings": [
      "*"
    ],
    "method": "GET",
    "extra_config": {
      "qos/ratelimit/router": {
        "max_rate": 1,
        "client_max_rate": 1,
        "strategy": "ip"
      }
    }
  }]
}

Expected behavior
I expect to see 429 and 503 responses. I use bombardier with 125 concurrent requests during 10 seconds. I get 100% 200 repsonse codes.

Additional context

If i change my extra_config to

"github.com/devopsfaith/krakend-ratelimit/juju/router": {
  "maxRate": 1,
  "capacity": 1,
  "clientMaxRate": 1,
  "strategy": "ip"
}

Then rate limiting work as expected. However this is the kraken 1.4 config directive.

@kpacha
Copy link
Member

kpacha commented Apr 1, 2022

There was an issue with the config parser. The fix is being released.

Thanks for the heads up!

@alombarte
Copy link
Member

Version 2.0.1 released.

@github-actions
Copy link

github-actions bot commented Jul 1, 2022

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.

@github-actions github-actions bot added the locked label Jul 1, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants