-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Dynamic Rule Configuration
All the rules can be queried or modified in memory and these modifications take effects immediately. And Sentinel also provides APIs for developers to defines its own rules.
There are 3 kinds of rules: Flow rules, degrade rules, system rules.
1.Flow Rules
Flow Rule has following fields:
field | description | default value |
---|---|---|
resource | resource name | |
count | thredshold | |
grade | depends on QPS or concurrency(active thread count) | QPS |
limitApp | whether to count on callers | no |
strategy | count on the resource itself; or on the relate resource(refResource),or on entry resource(refResource) | resource itself |
controlBehavior | how to action after block criteria is met, to block immediately, or wait in queue, or slow warm up | block immediatley |
One resource can apply several rules
2.Degrade Rule Degrade has following fields:
field | description | default value |
---|---|---|
resource | resource name | |
count | thredshold | |
grade | down grade o RT or qps | RT |
timeWindow | timewindow when degradation happens |
3.系统保护规则
Run following command to query current active rules:
curl http://localhost:8719/getRules?type=? ,type=flow will return all flow rules in JSON format;degrade will return all degrade rule in JSON format;and system will return system rules.
we can modify following rules via following command:
curl http://localhost:8719/setRules?type=&data=,data is the rules in JSON format.
All the rules configuration above are stored in memory, which means that rules will be lost if the application restart. Developer can implement DataSource to define his own persist rule logic.
- Via Diamond. Sample can refer to: Diamond
- Via SQL,GitHub, Sample ca refer to [TODO]
- Via Dashboard, sample can refer to [TODO]
-
文档
-
Documents
- Read Me
- Introduction
- How to Use
- How it Works
- Flow Control
- Parameter Flow Control
- Cluster Flow Control
- API Gateway Flow Control
- Circuit Breaking
- Adaptive System Protection
- Metrics
- General Configuration
- Dynamic Rule Configuration
- Dashboard
- Integrations with open-source frameworks
- Contribution Guideline