-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[WIP]cluster concurrent flow control #1629
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sczyh30
requested changes
Aug 4, 2020
sentinel-core/src/main/java/com/alibaba/csp/sentinel/Entry.java
Outdated
Show resolved
Hide resolved
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/ClusterFlowConfig.java
Show resolved
Hide resolved
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
@sczyh30 @cdfive @jasonjoo2010 现在基本功能已经完成,各位前辈如果有空可以帮忙测试一下性能和功能,代码优化和规范化的问题我会分批提交pr并优化 |
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
CST11021
pushed a commit
to CST11021/Sentinel
that referenced
this pull request
Nov 3, 2021
[ISSUE alibaba#1620]fix alibaba#1620 amout spell error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe what this PR does / why we need it
目前这个pr是集群并发流控的整体实现代码,基本功能已经实现,pr会拆分成多个提交,目前仅用于感兴趣的朋友测试,一起讨论完善方案,欢迎大家提出宝贵意见
Does this pull request fix one issue?
Fixes #1477
Describe how you did it
为了实现集群并发流控,我们必须存储每个调用的信息,发现并清除那些不正常的资源调用。具体的讲,当token client发起调用时会获得token Server颁发的身份标识tokenId, token server会存储这个tokenId值和相关的信息。当调用结束时,token client会携带着该次调用被分配的tokenId前往token server请求释放资源,token server会删除这个调用对应的 tokenId。通过这样的操作,我们能够实时的统计当前正在进行的调用数量,即并发量。如果出现资源调用超时或者token client掉线的情况,token server会尝试着去发现删除对应调用并清除存储的tokenId,从而获得准确的并发量nowCalls。
具体请见:
中文提案.pdf
English proposal .pdf
Describe how to verify it
演示视频: https://www.yuque.com/docs/share/4238f458-7bdf-4689-91e3-3c5527698731?# 《集群并发控制演示视频》
可以查看单元测试,也可以demo演示。
可以通过这两个demo进行测试,测试server端并发请求,client端并发请求,client端掉线,client端调用超时等情况, 需要在nacos配置动态规则
demo类如下:
sentinel-demo/sentinel-demo-cluster/sentinel-demo-cluster-server-alone/src/main/java/com/alibaba/csp/sentinel/demo/cluster/ClusterClientDemo.java
sentinel-demo/sentinel-demo-cluster/sentinel-demo-cluster-server-alone/src/main/java/com/alibaba/csp/sentinel/demo/cluster/ClusterServerDemo.java
动态规则如下:
流控效果大致如图所示,纵轴为并发数,横轴为请求顺序
Special notes for reviews