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

rateLimit not working as expected for long latency requests #10700

Closed
2 tasks done
inforly opened this issue May 7, 2024 · 3 comments
Closed
2 tasks done

rateLimit not working as expected for long latency requests #10700

inforly opened this issue May 7, 2024 · 3 comments

Comments

@inforly
Copy link

inforly commented May 7, 2024

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you do?

We used traefik as the ingressroute in kubernetes, the backend HTTP service needs long time to handle the requests and it can cache the requests. On average, a request takes 30s to complete.
To control the rate limit, we configured the rateLimite middleware, like 10 req/s, and we send requests as 20 req/s.

What did you see instead?

We saw traefik not working as expected, it only limited several requests, not as the one we configured.
Does traefik have different behaviors for long latency vs. short latency requests. We also tried the short latency service, like the whoami, the rateLimit work as expected.

What version of Traefik are you using?

0a79643

What is your environment & configuration?

  traefik.toml: |
    [metrics]
      [metrics.prometheus]
        entryPoint = "metrics"
        addEntryPointsLabels = true
        addServicesLabels = true
        buckets = [0.1, 0.3, 1.2, 5.0, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60]
    [accessLog]
      format = "json"
    [global]
      # prevent Traefik from checking newer versions in production
      checknewversion = false
      # prevent Traefik from collecting and sending stats from production
      sendanonymoususage = false
    [log]
      level = "INFO"
      format = "json"
    [api]
      dashboard = true
      insecure = true
    [providers]
      # Configuration reload frequency:
      #   * duration that Traefik waits for, after a configuration reload, before taking into account any new configuration refresh event
      #   * the most recent one is taken into account, and all the previous others are dropped.
      [providers.file]
        filename = "/config/traefik.toml"
        watch = true
      [providers.kubernetesCRD]
        throttleDuration = "10s"
        allowCrossNamespace = true
      [providers.kubernetesIngress]
    [entryPoints]
      [entryPoints.metrics]
        address = ":9100"
      [entryPoints.traefik]
        address = ":9000"
      [entryPoints.websecure]
        address = ":8443"
        [entryPoints.websecure.http.tls]
      [entryPoints.web]
        address = ":8000"

    [ping]
      entryPoint = "traefik"
    [tls]
      # without duplicating this cert config and with SNI enabled, Traefik won't
      # find the certificates for your host. It may be a Traefik's issue.
      [[tls.certificates]]
        certFile = "/mnt/secrets-store/tls.crt"
        keyFile = "/mnt/secrets-store/tls.key"
        stores = ["default"]
      [tls.stores]
        [tls.stores.default]
          [tls.stores.default.defaultCertificate]
            # without specifying in here your certs, Traefik will create its own
            # certificate
            certFile = "/mnt/secrets-store/tls.crt"
            keyFile = "/mnt/secrets-store/tls.key"

Add more configuration information here.

If applicable, please paste the log output in DEBUG level

No response

@inforly inforly changed the title rateLimit not working well for long latency requests rateLimit not working as expected for long latency requests May 7, 2024
@inforly
Copy link
Author

inforly commented May 7, 2024

Found it can't work with the requests even the latency about tens of milliseconds.

@nmengin
Copy link
Contributor

nmengin commented May 13, 2024

Hey @inforly,

Thanks for the feedback, I closed the issue accordingly.

@inforly
Copy link
Author

inforly commented May 18, 2024

Hey @inforly,

Thanks for the feedback, I closed the issue accordingly.

@nmengin why did you close this? Is this a problem? Could you give solution to such long latency request rate limit? Or will you take it as a feature request? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants