forked from gabriel-pinheiro/elba-balancer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelba.toml
84 lines (73 loc) · 2.81 KB
/
elba.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[server]
host = "0.0.0.0" # Interface to bind
port = 8080 # Port to listen
verbosity = "debug" # Minimum verbosity to log: debug,info,warn,error,fatal
#
# You can define as many [[service]]s as you'd like, here is an example with
# all parameters (note that only the "targets" param is required, you can omit
# anything else)
#
[[service]]
## This service will be chosen when the Host header is equal to this value
## Leave this blank or remove/comment it to match any host:
# host = "api.default.svc.cluster.local"
## The default is to set the upstream Host header from its URL, if you want to
## proxy the Host header from the downstream request, uncomment this line:
# proxy_host = true
# These are the URLs that will be balanced
[[service.target]]
name = "instance001" # Alias to show in the logs and metrics
url = "https://elba.mockoapp.net/s1" # URL to proxy to
[[service.target]]
name = "instance002"
url = "https://elba.mockoapp.net/s2"
[[service.target]]
name = "instance003"
url = "https://elba.mockoapp.net/s3"
[service.timeout]
connect = 3 # Maximum seconds to wait for a connection to be established, default: 3
target = 30 # Maximum seconds to wait for a target's response, default: 30
[service.health]
# Consecutive retriable errors to consider a target to be down, default: 3
threshold = 3
# Time to wait to mark a target as UP again, default: 10
timeout = 10
# If all targets are down, balance between all of them instead of failing with 503
# This can greatly increase the load in the upstream services because each request
# received might go to all of them several times deppending on the configs above
# default: false
none_healthy_is_all_healthy = false
[service.retry]
# Attempts limit, defaults to the amount of targets times two. First attempt is also
# counted, a limit of 6 means the first attempt and five retries.
limit = 6
delay = 100 # Millis to wait between retries, default: 100
# Millis to wait before retrying in a target that previously failed for
# a request, default: 3000
cooldown = 3000
# Errors that will trigger a retry, options available:
#
# CODE_502
# Connection errors, like a connection refused, broken pipe, etc
#
# CODE_504
# Timeout errors, like a timeout on a socket read
#
# CODE_404
# CODE_429
# CODE_500
# CODE_503
# ...and so on
# Consider that response code from the upstream as a retryable error, you can pick any code
#
# CODE_4XX
# Consider any code < 500 and >= 400 to be retryable
#
# CODE_5XX
# Consider any code >= 500 to be retryable
#
# This setting defaults to ["CODE_502", "CODE_503", "CODE_504"]
retryable_errors = ["CODE_502", "CODE_503", "CODE_504"]
#
# You can define more services by repeating the above section from [[service]] to the end
#