-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposing Canary Rate Threshold to be configurable and usable (#593)
* fetching files * add missing file * missing utils * [Gradle Release Plugin] - new version commit: '3.30.6-snapshot'. * [Gradle Release Plugin] - new version commit: '3.31.0-snapshot'. * release notes * creating docs * add refs * setup factory
- Loading branch information
Showing
14 changed files
with
360 additions
and
32 deletions.
There are no files selected for viewing
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
111 changes: 111 additions & 0 deletions
111
docs/content/2-features/remote-solver-circuitbreaker/_index.en.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
--- | ||
title: Remote Solver Circuit Breaker | ||
--- | ||
|
||
DPS use circuit breaker strategies to choose the most available Remote Server from the configured ones. | ||
|
||
## Static Threshold | ||
|
||
* Consider all remote servers circuits as **closed** on app start. | ||
* Opens and closes circuits based on fixed number of failures or successes. | ||
|
||
|
||
#### Configuration Example | ||
|
||
```json | ||
{ | ||
"version": 2, | ||
"remoteDnsServers": [], | ||
"envs": [], | ||
"activeEnv": "", | ||
"webServerPort": 5380, | ||
"dnsServerPort": 53, | ||
"logLevel": "INFO", | ||
"logFile": "console", | ||
"registerContainerNames": false, | ||
"domain": "docker", | ||
"dpsNetwork": false, | ||
"dpsNetworkAutoConnect": false, | ||
"defaultDns": true, | ||
"hostMachineHostname": "host.docker", | ||
"serverProtocol": "UDP_TCP", | ||
"dockerHost": null, | ||
"resolvConfOverrideNameServers": true, | ||
"noRemoteServers": false, | ||
"noEntriesResponseCode": 3, | ||
"dockerSolverHostMachineFallbackActive": true, | ||
"solverRemote": { | ||
"circuitBreaker": { | ||
"failureThreshold": 3, | ||
"failureThresholdCapacity": 10, | ||
"successThreshold": 5, | ||
"testDelay": "PT20S" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
* **failureThreshold**: How many attempts before open the circuit? | ||
* **failureThresholdCapacity**: How many attempts store to the stack? | ||
* **successThreshold**: How many attempts before close the circuit? | ||
* **testDelay**: How much time to wait before test the circuit again?, see [Duration docs][1] for format explanation | ||
|
||
|
||
## Canary Rate Threshold | ||
|
||
* Consider all remote servers circuits as **open** on app start | ||
* Opens and closes circuits based on percentage of failure | ||
|
||
#### Consider all remote servers circuits as open on app start | ||
|
||
Test them on startup and add the healthy ones as HALF_OPEN this will evict to app get resolution fails right on the | ||
start because the first server on the remote servers list is offline. | ||
|
||
#### Configuration Example | ||
|
||
```json | ||
{ | ||
"version": 2, | ||
"remoteDnsServers": [], | ||
"envs": [], | ||
"activeEnv": "", | ||
"webServerPort": 5380, | ||
"dnsServerPort": 53, | ||
"logLevel": "INFO", | ||
"logFile": "console", | ||
"registerContainerNames": false, | ||
"domain": "docker", | ||
"dpsNetwork": false, | ||
"dpsNetworkAutoConnect": false, | ||
"defaultDns": true, | ||
"hostMachineHostname": "host.docker", | ||
"serverProtocol": "UDP_TCP", | ||
"dockerHost": null, | ||
"resolvConfOverrideNameServers": true, | ||
"noRemoteServers": false, | ||
"noEntriesResponseCode": 3, | ||
"dockerSolverHostMachineFallbackActive": true, | ||
"solverRemote": { | ||
"circuitBreaker": { | ||
"strategy": "CANARY_RATE_THRESHOLD", | ||
"failureRateThreshold": 21, | ||
"minimumNumberOfCalls": 50, | ||
"permittedNumberOfCallsInHalfOpenState": 10 | ||
} | ||
} | ||
} | ||
``` | ||
|
||
* **failureRateThreshold**: If the failure rate is equal to or greater than this threshold, the CircuitBreaker will | ||
transition to open. rules: values greater than 0 and not greater than 100. | ||
* **minimumNumberOfCalls**: Configures the minimum number of calls which are required (per sliding window period) before | ||
the CircuitBreaker can calculate the error rate. | ||
* **permittedNumberOfCallsInHalfOpenState**: Configures the number of permitted calls when the CircuitBreaker is half | ||
open. | ||
|
||
## Refs | ||
|
||
* [A more resilient circuit breaker strategy #533][2] | ||
|
||
[1]: https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#toString-- | ||
[2]: https://github.com/mageddo/dns-proxy-server/issues/533 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=3.30.5-snapshot | ||
version=3.31.0-snapshot |
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
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
26 changes: 21 additions & 5 deletions
26
src/main/java/com/mageddo/dnsproxyserver/config/validator/CircuitBreakerValidator.java
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
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
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
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
Oops, something went wrong.