Last active
September 12, 2021 01:57
-
-
Save haproxytechblog/12dd1dc7dc64cddafdf587cd13160b22 to your computer and use it in GitHub Desktop.
HAProxy Layer 7 Retries and Chaos Engineering
This file contains hidden or 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
backend be_servers | |
balance roundrobin | |
server s1 server1:80 maxconn 10 | |
server s2 server2:80 maxconn 10 | |
server s3 server3:80 maxconn 10 |
This file contains hidden or 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
fe_main be_servers/s1 0/0/-1/-1/12006 503 216 - - sC-- 1/1/0/0/3 0/0 "GET / HTTP/1.1" |
This file contains hidden or 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
backend be_servers | |
balance roundrobin | |
option redispatch | |
server s1 server1:80 maxconn 10 | |
server s2 server2:80 maxconn 10 | |
server s3 server3:80 maxconn 10 |
This file contains hidden or 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
fe_main be_servers/s2 0/3000/0/6/3006 200 228 - - ---- 1/1/0/0/+1 0/0 "GET / HTTP/1.1" |
This file contains hidden or 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
fe_main be_servers/s1 0/0/0/-1/1757 502 229 - - SH-- 1/1/0/0/0 0/0 "GET / HTTP/1.1" |
This file contains hidden or 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
backend be_servers | |
balance roundrobin | |
option redispatch | |
retry-on empty-response | |
server s1 server1:80 maxconn 10 | |
server s2 server2:80 maxconn 10 | |
server s3 server3:80 maxconn 10 |
This file contains hidden or 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
$ sudo pumba netem --tc-image gaiadocker/iproute2 --duration 5m delay --time 5000 server1 |
This file contains hidden or 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
defaults | |
log global | |
mode http | |
option httplog | |
timeout connect 3s | |
timeout client 5s | |
timeout server 5s | |
timeout queue 30s |
This file contains hidden or 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
backend be_servers | |
balance roundrobin | |
option redispatch | |
retry-on empty-response conn-failure | |
server s1 server1:80 maxconn 10 | |
server s2 server2:80 maxconn 10 | |
server s3 server3:80 maxconn 10 |
This file contains hidden or 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
proxy: | |
- name: http_proxy | |
config: | |
host: 0.0.0.0 # muxy IP | |
port: 81 # muxy port | |
proxy_host: server1 # proxied IP/host | |
proxy_port: 80 # proxied port | |
middleware: | |
- name: delay | |
config: | |
response_delay: 5000 |
This file contains hidden or 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
backend be_servers | |
balance roundrobin | |
option redispatch | |
retry-on empty-response conn-failure | |
server s1 muxy:81 maxconn 10 | |
server s2 server2:80 maxconn 10 | |
server s3 server3:80 maxconn 10 |
This file contains hidden or 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
fe_main be_servers/s1 0/0/1/-1/5001 504 218 - - sH-- 1/1/0/0/0 0/0 "GET / HTTP/1.1" |
This file contains hidden or 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
retry-on empty-response conn-failure response-timeout |
This file contains hidden or 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
proxy: | |
- name: http_proxy | |
config: | |
host: 0.0.0.0 | |
port: 81 | |
proxy_host: server1 | |
proxy_port: 80 | |
middleware: | |
- name: http_tamperer | |
config: | |
response: | |
status: 500 |
This file contains hidden or 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
retry-on empty-response conn-failure response-timeout 500 |
This file contains hidden or 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
fe_main be_servers/s2 0/16/0/16/32 200 224 - - ---- 1/1/0/0/+1 0/0 "GET / HTTP/1.1" |
This file contains hidden or 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
retry-on all-retryable-errors |
This file contains hidden or 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
retry-on conn-failure empty-response junk-response response-timeout 0rtt-rejected 500 502 503 504 |
This file contains hidden or 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
backend be_servers | |
balance roundrobin | |
option redispatch 1 | |
retry-on all-retryable-errors | |
retries 3 | |
http-request disable-l7-retry if METH_POST | |
server s1 server1:80 maxconn 10 | |
server s2 server2:80 maxconn 10 | |
server s3 server3:80 maxconn 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment