-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[feature]Adaptive Flow Control with Q learning algorithm #1673
Conversation
please sign the CLA. |
Signed-off-by: yunfeiyanggzq <[email protected]>
Introduce support through a customized client builder `SentinelApacheHttpClientBuilder`.
…libaba#1607) Signed-off-by: yunfeiyanggzq <[email protected]>
- One config per interceptor instead of the global config - Polish document and demo Signed-off-by: Eric Zhao <[email protected]>
…aba#1529) Signed-off-by: yunfeiyanggzq <[email protected]>
…rove strategy * Add `CircuitBreaker` abstraction (with half-open state) and add circuit breaker state change event observer support. * Improve circuit breaking strategy (avg RT → slow request ratio) and make statistics of each rule dependent (to support arbitrary statistic interval). * Add simple "trial" mechanism (aka. half-open). * Refactor mechanism of metric recording and state change handling for circuit breakers: record RT and error when requests have completed (i.e. `onExit`, based on alibaba#1420). Signed-off-by: Eric Zhao <[email protected]>
Signed-off-by: Eric Zhao <[email protected]>
Signed-off-by: Eric Zhao <[email protected]>
…uarkus Signed-off-by: Eric Zhao <[email protected]>
Signed-off-by: Eric Zhao <[email protected]>
…1655) Signed-off-by: yunfeiyanggzq <[email protected]>
…ogic for validation Signed-off-by: Eric Zhao <[email protected]>
- Fix NPE bug in consumer filter (when non-biz error occurred) - Improve default fallback in Dubbo 2.7.x adapter: convert the BlockException to a simple RuntimeException (with necessary message) - Polish code and comments Signed-off-by: Eric Zhao <[email protected]>
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
c3ca407
to
7cce9cc
Compare
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
…terGlobalConfig (alibaba#1572) * Unify Dubbo callback registry (for fallback and origin parser) into DubboAdapterGlobalConfig * Polish default fallback implementation (wrap exception with RpcResult rather than directly throw it out) Signed-off-by: Eric Zhao <[email protected]>
Describe what this PR does / why we need it
在服务数量多,拓扑复杂,处理能力逐渐变化的情况下,使用固定的最大并发会带来巨大的测试工作量,并且用户需要手动地设置很多流控规则。自适应限流就是为了解决这个问题。我们希望使用Q-Learning算法,引入智能的自适应流控策略进行限流,在最大化吞吐量的同时保障系统服务的稳定。相关issue可见#748 #1641
Does this pull request fix one issue?
#748
Describe how you did it
使用强化学习Q-Learning算法实现自适应流控。
QLearningLearner.java实现了算法的迭代更新。
QLearningMetric.java实现了算法的主要方法与参数设置。
QTableStorage.java实现QTable的读写与存储。
QInfo.java存储了决策前状态(state)、行为(action)、效用(utility)的信息。
Describe how to verify it
sentinel-demo/sentinel-demo-basic/src/main/java/com/alibaba/csp/sentinel/demo/qlearning/UserPeakCpuDemo.java 实现了简单的峰值流量场景测试。
测试时,
isTraining
为false,不更新QTable。训练时,将
isTraining
设为true,可以更新QTable。启用QLearning的开关为
isQLearning
,设置为false时,不使用QLearning算法进行自适应流控。Special notes for reviews