-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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:codis-proxy bigKey/Request fuse protection #2646
Conversation
# quick command list | ||
quick_cmd_list = "get,set" | ||
# slow command list | ||
slow_cmd_list = "mget, mset" |
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.
这里还是还原回去吧
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.
ok
monitor_log_max_len = 10000 | ||
# set the limitation of result set for xmonitor log | ||
monitor_result_set_size = 20 | ||
# switch for xmonitor,0 is disabled, 1 is enabled |
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.
这里是把监控也做了吗
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.
是的,除了一些特定的命令外,每一次请求/响应若被判定为bigRequest/Key、HighRisk则会存入日志,以便于使用命令"XMonitor"查看
关闭一个 Proxy 然后重启,其大 key 信息不存在,但 Pika 大 key 信息还存在,造成 Proxy 与 Pika 大 key 信息不一致。 |
When a Proxy is closed and then restarted, its big key information does not exist, but the Pika big key information still exists, causing the Proxy and Pika big key information to be inconsistent. |
) | ||
|
||
const ( | ||
BUCKET_FILL_INTERVAL int64 = 10 // 令牌桶填充间隔,以一秒为单位进行划分,比如值为10,qps为10000,意味着间隔为1s/10 = 100ms,桶容量为10000/10 = 1000 |
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.
所有的中文注释,改为英文的
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.
收到
|
||
// 令牌桶操作 | ||
func isAllowed() bool { | ||
if limiterState.Int64() == SWITCH_CLOSED { // 限流器关闭状态,直接返回true,允许请求通过 |
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.
return limiterState.Int64() == SWITCH_CLOSED || limiter.Allow()
本 PR 的功能是做大 key 分析吗?还有必要做 熔断 逻辑吗?可以把你的思路和步骤详细的写一下 |
Is the function of this PR to do big key analysis? Is it still necessary to do circuit breaker logic? You can write down your ideas and steps in detail. |
@CodiumAI-Agent /review |
PR Review 🔍
Code feedback:
|
@CodiumAI-Agent /improve |
Failed to generate code suggestions for PR |
本PR有关<bigKey/Request监测,黑白名单,qps令牌桶限流>以及上述情况的熔断(可设置百分比),思路与步骤稍后我会挂一篇Blog解释 |
This PR is about <bigKey/Request monitoring, black and white list, qps token bucket current limit> and the circuit breaker in the above situation (the percentage can be set). I will explain the ideas and steps in a blog later. |
目前解决思路是,将MonitorLog信息从内存迁移到磁盘,新proxy实例可以从磁盘文件读取到之前的Log信息,具体实现正在与 @chejinge 导师讨论 |
The current solution is to migrate MonitorLog information from memory to disk. The new proxy instance can read the previous Log information from the disk file. The specific implementation is being discussed with @chejinge instructor. |
@XiaoLiang2333 代码中不要出现中文 |
@XiaoLiang2333 Do not allow Chinese characters to appear in the code |
好的 |
OK |
#1691
#2228