-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhaproxy.cfg
27 lines (24 loc) · 847 Bytes
/
haproxy.cfg
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
# in docker container this file should be located on path
# /etc/haproxy/haproxy.cfg
global
# define connections limit
maxconn 10000
defaults
# http mode allow to handle websocket connections
mode http
retries 2
# difine how long haproxy can wait to establish a connection
timeout connect 5s
timeout client 25s
timeout server 25s
frontend http-in
# bind connections coming to all available network interfaces on port 8888
bind *:8888
default_backend websockets
# difine websockets server instances
backend websockets
# use leastconn distribute algorithm to distribute connections evenly
# between every server instance
balance leastconn
# for each server set limit of 2000 connections
server websocket_server websocket_server:8888 maxconn 2000 check