Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Created January 29, 2021 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haproxytechblog/603ba2de669eb22e0d04df77cc25ef3f to your computer and use it in GitHub Desktop.
Save haproxytechblog/603ba2de669eb22e0d04df77cc25ef3f to your computer and use it in GitHub Desktop.
HAProxy Connection Limits and Queues
global
maxconn 60000
global
maxconn 60000
frontend website
maxconn 20000
bind :80
default_backend web_servers
frontend database
maxconn 20000
bind :3306
default_backend database_servers
frontend api
maxconn 20000
bind :8080
default_backend api_servers
frontend website
maxconn 20000
bind :80
default_backend web_servers
backend web_servers
balance roundrobin
server s1 192.168.0.10:80
server s2 192.168.0.11:80
server s3 192.168.0.12:80
backend web_servers
balance roundrobin
server s1 192.168.0.10:80 maxconn 30
server s2 192.168.0.11:80 maxconn 30
server s3 192.168.0.12:80 maxconn 30
backend web_servers
mode http
balance roundrobin
server s1 192.168.0.10:80 maxconn 30
server s2 192.168.0.11:80 maxconn 30
server s3 192.168.0.12:80 maxconn 30
backend web_servers
balance roundrobin
timeout queue 30s
server s1 192.168.0.10:80 maxconn 30
server s2 192.168.0.11:80 maxconn 30
server s3 192.168.0.12:80 maxconn 30
backend web_servers
balance roundrobin
acl is_checkout path_beg /checkout/
http-request set-priority-class int(1) if is_checkout
http-request set-priority-class int(2) if !is_checkout
timeout queue 30s
server s1 192.168.0.10:80 maxconn 30
server s2 192.168.0.11:80 maxconn 30
server s3 192.168.0.12:80 maxconn 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment