-
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. Sentinel also provides APIs for you to define your own rules.
There are 3 kinds of rules: flow rules, degradation rules, and system rules.
1.Flow Rules
Flow Rule has the 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 related resource(refResource),or on entry resource(refResource) | resource itself |
controlBehavior | how to act after block criteria are met. To block immediately, or wait in a queue, or slow warm up | block immediatley |
Multiple rules can be applied to one resource.
2.Degradation Rules Degrade has the following fields:
Field | Description | Default value |
---|---|---|
resource | resource name | |
count | thredshold | |
grade | down grade o RT or qps | RT |
timeWindow | timewindow when degradation happens |
- System Protection Rules
Run the following command to query current active rules:
curl http://localhost:8719/getRules?type=? ,type=flow
If the type is flow, it will return all flow rules in JSON format; if the type is degrade, it will return all degradation rules in JSON format; and if the type is system, it will return system rules.
You can modify the following rules via the following command:
curl http://localhost:8719/setRules?type=<XXXX>&data=<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. We can implement DataSource to define persist rule logic.
-
文档
-
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