Skip to content

bug: limit-count  #11774

Open
Open
@jeremy1392

Description

@jeremy1392

Current Behavior

I try to apply limit-count with redis to limit the API rate per consumers.
My redis server works well.

limit-count info:

count: 1000
time_window: 1000
key_type: var
key: consumer_name
rejected_code: 503
rejected_msg: API limit exceeds
policy: redis
allow_degradation: false
show_limit_quota_header: true
redis_host: redis.XXXX.XX
redis_port: 6379
redis_password: XXXXXX
redis_database: 0
redis_timeout: 1000

The 1st bug: it applies limit on routes and not on global and consumer_name is not working.
image

The 2nd bug: after some times, the plugin crashes:

Expected Behavior

API rate at consumer_name level.
If I have 30 routes and 1 consumer with API rate limiting of 1000.
I expect to have those 3000 requests split across routes.

Error Logs

2024/11/21 20:37:20 [warn] 57#57: 8 [lua] plugin.lua:954: decrypt_conf(): failed to get schema for plugin: limit-count, context: init_worker_by_lua

Steps to Reproduce

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e9dd32464ac9 apache/apisix:latest "/docker-entrypoint.…" 57 minutes ago Up 2 minutes 0.0.0.0:32936->9080/tcp, :::32936->9080/tcp, 0.0.0.0:32935->9091/tcp, :::32935->9091/tcp, 0.0.0.0:32934->9092/tcp, :::32934->9092/tcp, 0.0.0.0:32933->9180/tcp, :::32933->9180/tcp, 0.0.0.0:32932->9443/tcp, :::32932->9443/tcp root_apisix_1
633a442adcf6 nginx:alpine "/docker-entrypoint.…" 6 weeks ago Up 6 weeks 0.0.0.0:80->80/tcp, :::80->80/tcp loadbalancer
d0b2957d213a apache/apisix-dashboard:3.0.0-alpine "/usr/local/apisix-d…" 6 weeks ago Up 6 weeks 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp apisix-dashboard
b9fe507b91d2 prom/prometheus:v2.25.0 "/bin/prometheus --c…" 6 weeks ago Up 6 weeks 9090/tcp prometheus
93afedfafa73 grafana/grafana:latest "/run.sh" 6 weeks ago Up 6 weeks 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp grafana
1eb17a543ca0 bitnami/etcd:3.5.11 "/opt/bitnami/script…" 6 weeks ago Up 6 weeks 0.0.0.0:2379->2379/tcp, :::2379->2379/tcp, 2380/tcp etcd
8538722a1a75 grafana/loki:latest "/usr/bin/loki -conf…" 6 weeks ago Up 6 weeks 0.0.0.0:3100->3100/tcp, :::3100->3100/tcp loki

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwait for updatewait for the author's response in this issue/PR

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions