-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: add redis and redis-cluster in limit-req #10874
feat: add redis and redis-cluster in limit-req #10874
Conversation
620c52d
to
a56f254
Compare
I would suggest working on this only after redis support for |
Yeah, I think so. |
@theweakgod we may start working on this now. Please make changes carefully and diligently considering the code review we did for |
ok |
@shreemaan-abhishek @monkeyDluffy6017 I'm ready for the review. |
apisix/plugins/limit-req.lua
Outdated
elseif conf.policy == "redis" then | ||
|
||
core.log.info("create new limit-req redis plugin instance") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
docs/en/latest/plugins/limit-req.md
Outdated
| allow_degradation | boolean | False | false | | When set to `true` enables Plugin degradation when the Plugin is temporarily unavailable and allows requests to continue. | | ||
| Name | Type | Required | Default | Valid values | Description | | ||
|--------------------------|---------| -------- |-------------|-----------------------------------| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| conn | integer | True | | conn > 0 | Maximum number of concurrent requests allowed. Requests exceeding this ratio (and below `conn` + `burst`) will be delayed (configured by `default_conn_delay`). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conn?
docs/en/latest/plugins/limit-req.md
Outdated
| Name | Type | Required | Default | Valid values | Description | | ||
|--------------------------|---------| -------- |-------------|-----------------------------------| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| conn | integer | True | | conn > 0 | Maximum number of concurrent requests allowed. Requests exceeding this ratio (and below `conn` + `burst`) will be delayed (configured by `default_conn_delay`). | | ||
| burst | integer | True | | burst >= 0 | Number of additional concurrent requests allowed to be delayed per second. If the number exceeds this hard limit, they will get rejected immediately. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check the docs, it has unrelated changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This reverts commit 1439b13.
Description
Fixes #10501 (#10501)
Add options for redis and redis-cluster in the limit-req plugin, and use redis as the counter.
Checklist