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

Global rate limit is not accurate: 10 limit tps, but can reach 30 tps #31

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

datavisorhenryzhao
Copy link

@datavisorhenryzhao datavisorhenryzhao commented Jan 22, 2024

When I using ingress-nginx controller on k8s, and enable global rate limit. But find that the limit tps does not work well.

ingress-nginx controller cm

global-rate-limit-memcached-connect-timeout:50ms
global-rate-limit-memcached-host:memcached.ingress-nginx.svc.cluster.local
global-rate-limit-memcached-max-idle-timeout:50ms
global-rate-limit-memcached-pool-size: "10000"
global-rate-limit-memcached-port:"11211"

app ingress

apiVersion: v1
items:
- apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    annotations:
      nginx.ingress.kubernetes.io/global-rate-limit: "10"
      nginx.ingress.kubernetes.io/global-rate-limit-key: $request_uri
      nginx.ingress.kubernetes.io/global-rate-limit-window: 1s
    creationTimestamp: "2024-01-18T02:29:56Z"
    generation: 1
    name: demo-localhost
    namespace: henry-test
    resourceVersion: "28783032"
    uid: fd40379e-f635-4533-90bc-0f4b56ce7430
  spec:
    ingressClassName: nginx
    rules:
    - host: demo.localdev.me
      http:
        paths:
        - backend:
            service:
              name: demo
              port:
                number: 80
          path: /
          pathType: Prefix
  status:
    loadBalancer:
      ingress:
      - ip: 3.239.19.65
kind: List
metadata:
  resourceVersion: ""

Using wrk test
image

After modifying code, it looks better
image

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

Successfully merging this pull request may close these issues.

1 participant