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 plugin doesn't work properly #2495

Closed
ShinEDL opened this issue May 4, 2017 · 4 comments
Closed

Rate-limiting plugin doesn't work properly #2495

ShinEDL opened this issue May 4, 2017 · 4 comments

Comments

@ShinEDL
Copy link

ShinEDL commented May 4, 2017

Summary

I created a rate-limiting plugin which limit by consumer and set policy to "redis", but it doesn't work properly.

Steps To Reproduce

1.Create a api named "api_test"
2.Create a consumer named "consumer_test" and add a key of key-auth for it.
3.Create a key-auth plugin apply to "api_test".
4.Create a rate-limiting plugin which apply to "consumer_test" and "api_test", set policy to "redis".

some configuration:
config.minute = 1
config.redis_database = 1
config.limit_by = consumer
config.policy = redis

Other configuration is default, and redis_host and redis_password is correct.

5.Run two request to "api_test", it can work properly (one proxy, one limited). However, one second later, I run another request to "api_test", it can proxy.

ps: 1. the interval is one minute;
2. redis server can't find the key about rate-limiting.

Additional Details & Logs

  • Kong version (0.10.1 & 0.10.2)
  • Kong debug-level startup logs (N/A)
  • Kong error logs (N/A)
  • Kong configuration (nature)
  • Operating System (docker/ubuntu)
@ShinEDL
Copy link
Author

ShinEDL commented May 4, 2017

Whether postgres will affect this?

@ShinEDL ShinEDL closed this as completed May 4, 2017
@ShinEDL ShinEDL reopened this May 4, 2017
@ShinEDL ShinEDL changed the title Rate-limiting plugin doesn't work Rate-limiting plugin doesn't work properly May 4, 2017
@ShinEDL
Copy link
Author

ShinEDL commented May 4, 2017

Sometimes it even dosen't work anymore...let all request be proxied...

@p0pr0ck5
Copy link
Contributor

p0pr0ck5 commented May 4, 2017

There was a recent PR that seems related; can you have a look at #2481 and see if this solves your problem?

@ShinEDL
Copy link
Author

ShinEDL commented May 5, 2017

@p0pr0ck5 At last, I found that if I set redis_database to 0, it work fine.

@ShinEDL ShinEDL closed this as completed May 5, 2017
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

No branches or pull requests

2 participants