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 Limiting blocks everything after a while #827

Closed
filex opened this issue Jun 20, 2024 · 0 comments · Fixed by #829
Closed

Rate Limiting blocks everything after a while #827

filex opened this issue Jun 20, 2024 · 0 comments · Fixed by #829
Assignees
Labels
bug Something isn't working
Milestone

Comments

@filex
Copy link
Contributor

filex commented Jun 20, 2024

Describe the bug

I have a set up where I use Couper as an egress Gateway to implement a client-side rate limiting.

(I have a group of services that use the same rate-limited upstream API. The services run independently, so I wanted to have central exit point where I can count/throttle requests.)

Because the upstream is very rigid, I use a connection pool size of 1 and a rate limiter.

At first it works fine. Requests are throttled but succeed after queueing for a bit. But it can happen that too many requests pile up and the queue get longer. Sometimes that leads to requests being canceled by the HTTP clients (because they also have their timeouts).

After some time, Couper is in a state where all incoming requests are stuck in an endless block/wait queue. Even if there weren't any requests over a couple of minutes (the rate limiter window is a minute), all new requests wait forever until they timeout.

I cannot reproduce it yet, but it happens again and again. I have to restart Couper to get out of it.

To Reproduce
Steps to reproduce the behavior:

?

  1. Which Couper version? Run couper version or docker run coupergateway/couper version

1.12.1 and edge

  1. Provide your configuration file *.hcl. Remove sensitive data.
definitions {
  backend "upstream" {
    origin = env.ORIGIN
    max_connections = env.MAX_CONNECTIIONS
    set_request_headers = {
      authorization = request.headers.authorization
    }
    beta_rate_limit {
      mode = "wait"
      period = "60s"
      per_period = env.REQUESTS_PER_MINUTE
      period_window = "fixed"
    }
  }
}
@filex filex added the bug Something isn't working label Jun 20, 2024
@malud malud self-assigned this Jun 20, 2024
@malud malud added this to the 1.13 milestone Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants