-
Notifications
You must be signed in to change notification settings - Fork 3
/
haproxy.cfg.template
46 lines (38 loc) · 1.64 KB
/
haproxy.cfg.template
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
global
maxconn 4096
defaults
mode tcp
# Timeout values should be configured for your specific use.
# See: https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4-timeout%20connect
# With the timeout connect 5 secs,
# if the backend server is not responding, haproxy will make a total
# of 3 connection attempts waiting 5s each time before giving up on the server,
# for a total of 15 seconds.
retries 2
timeout connect 5s
# timeout client and server govern the maximum amount of time of TCP inactivity.
# The server node may idle on a TCP connection either because it takes time to
# execute a query before the first result set record is emitted, or in case of
# some trouble on the server. So these timeout settings should be larger than the
# time to execute the longest (most complex, under substantial concurrent workload)
# query, yet not too large so truly failed connections are lingering too long
# (resources associated with failed connections should be freed reasonably promptly).
timeout client 10m
timeout server 10m
# TCP keep-alive on client side. Server already enables them.
option clitcpka
frontend stats
bind *:8404
stats enable
stats uri /stats
stats refresh 10s
stats admin if TRUE
# Consider a better password for stats admin access
stats auth haproxy:haproxy
listen psql
bind :26257
mode tcp
balance roundrobin
option httpchk GET /health?ready=1
# server cockroach1 10.138.0.33:26257 check port 26258
# server cockroach2 10.138.0.43:26257 check port 26258