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

网关限流修改配置后未生效 #22

Open
wangkaihust opened this issue Jan 7, 2022 · 3 comments
Open

网关限流修改配置后未生效 #22

wangkaihust opened this issue Jan 7, 2022 · 3 comments

Comments

@wangkaihust
Copy link

站点流量配置设置每60s限制访问10个,保存测试生效。后改为60s限制访问0个,保存测试不生效。
目前怀疑FlowControlManager::loadDB()函数中判断if (maxID == _maxFlowID)满足条件直接return了,未从t_flow_control表中获取最新的限流配置

@shevqko
Copy link
Contributor

shevqko commented Jan 8, 2022

配置信息, 设计上有限制流量要大于0,如果限制流量为0,相当于关闭站点了, 就不需要限制流量。
代码里面有限制:
if (duration <= 0 || flow <= 0)
{
continue;
}

@wangkaihust
Copy link
Author

配置信息, 设计上有限制流量要大于0,如果限制流量为0,相当于关闭站点了, 就不需要限制流量。 代码里面有限制: if (duration <= 0 || flow <= 0) { continue; }

是的,我把限制流量改为0,理想情况就是不再限流,但是实际测试情况还是按照之前的策略进行限流。目前看loadDB函数无法从数据库中获取最新的限流配置导致的

@wangkaihust
Copy link
Author

官方文档里提到:
黑白名单配置通过自定义命令loadComm 可以使配置生效。流控配置后会在5分钟内自动生效。

实际上流控配置后,如果修改当前流控配置的速率,比如从60s限制100次调用改为60s限制200次调用,这个更新并不会生效。
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

No branches or pull requests

2 participants