1HAPROXY(1) General Commands Manual HAPROXY(1)
2
3
4
6 HAProxy - fast and reliable http reverse proxy and load balancer
7
8
10 haproxy -f <configuration file> [-n maxconn] [-N maxconn] [-d] [-D]
11 [-q] [-V] [-c] [-p <pidfile>] [-s] [-l] [-dk] [-ds] [-de] [-dp] [-db]
12 [-m <megs>] [{-sf|-st} pidlist...]
13
14
16 HAProxy is a TCP/HTTP reverse proxy which is particularly suited for
17 high availability environments. Indeed, it can:
18 - route HTTP requests depending on statically assigned cookies ;
19 - spread the load among several servers while assuring server
20 persistence through the use of HTTP cookies ;
21 - switch to backup servers in the event a main one fails ;
22 - accept connections to special ports dedicated to service
23 monitoring ;
24 - stop accepting connections without breaking existing ones ;
25 - add/modify/delete HTTP headers both ways ;
26 - block requests matching a particular pattern ;
27 - hold clients to the right application server depending on
28 application cookies
29 - report detailed status as HTML pages to authenticated users from an
30 URI intercepted from the application.
31
32 It needs very little resource. Its event-driven architecture allows it
33 to easily handle thousands of simultaneous connections on hundreds of
34 instances without risking the system's stability.
35
36
38 -f <configuration file>
39 Specify configuration file path.
40
41
42 -n <maxconn>
43 Set the high limit for the total number of simultaneous connec‐
44 tions.
45
46
47 -N <maxconn>
48 Set the high limit for the per-listener number of simultaneous
49 connections.
50
51
52 -d Start in foregreound with debugging mode enabled. When the
53 proxy runs in this mode, it dumps every connections, disconnec‐
54 tions, timestamps, and HTTP headers to stdout. This should NEVER
55 be used in an init script since it will prevent the system from
56 starting up.
57
58
59 -D Start in daemon mode.
60
61
62 -q Disable messages on output.
63
64
65 -V Displays messages on output even when -q or 'quiet' are speci‐
66 fied. Some information about pollers and config file are dis‐
67 played during startup.
68
69
70 -c Only checks config file and exits with code 0 if no error was
71 found, or exits with code 1 if a syntax error was found.
72
73
74 -p <pidfile>
75 Ask the process to write down each of its children's pids to
76 this file in daemon mode.
77
78
79 -s Show statistics (only if compiled in). Statistics are only
80 available if compiled in with the 'STATTIME' option. It's only
81 used during code optimization phases, and will soon disappear.
82
83
84 -l Show even more statistics (implies '-s').
85
86
87 -dk Disable use of kqueue(). kqueue() is available only on BSD sys‐
88 tems.
89
90
91 -ds Disable use of speculative epoll(). epoll() is available only on
92 Linux 2.6 and some custom Linux 2.4 systems.
93
94
95 -de Disable use of epoll(). epoll() is available only on Linux 2.6
96 and some custom Linux 2.4 systems.
97
98
99 -dp Disables use of poll(). select() might be used instead.
100
101
102 -db Disables background mode (stays in foreground, useful for debug‐
103 ging). For debugging, the '-db' option is very useful as it
104 temporarily disables daemon mode and multi-process mode. The
105 service can then be stopped by simply pressing Ctrl-C, without
106 having to edit the config nor run full debug.
107
108
109 -m <megs>
110 Enforce a memory usage limit to a maximum of <megs> megabytes.
111
112
113 -sf <pidlist>
114 Send FINISH signal to the pids in pidlist after startup. The
115 processes which receive this signal will wait for all sessions
116 to finish before exiting. This option must be specified last,
117 followed by any number of PIDs. Technically speaking, SIGTTOU
118 and SIGUSR1 are sent.
119
120
121 -st <pidlist>
122 Send TERMINATE signal to the pids in pidlist after startup. The
123 processes which receive this signal will wait immediately termi‐
124 nate, closing all active sessions. This option must be specified
125 last, followed by any number of PIDs. Technically speaking,
126 SIGTTOU and SIGTERM are sent.
127
128
130 Since HAProxy can run inside a chroot, it cannot reliably access
131 /dev/log. For this reason, it uses the UDP protocol to send its logs
132 to the server, even if it is the local server. People who experience
133 trouble receiving logs should ensure that their syslog daemon listens
134 to the UDP socket. Several Linux distributions which ship with syslogd
135 from the sysklogd package have UDP disabled by default. The -r option
136 must be passed to the daemon in order to enable UDP.
137
138
140 Some signals have a special meaning for the haproxy daemon. Generally,
141 they are used between daemons and need not be used by the administra‐
142 tor.
143
144 - SIGUSR1
145 Tells the daemon to stop all proxies and exit once all sessions
146 are closed. It is often referred to as the "soft-stop" signal.
147
148 - SIGTTOU
149 Tells the daemon to stop listening to all sockets. Used inter‐
150 nally by -sf and -st.
151
152 - SIGTTIN
153 Tells the daemon to restart listening to all sockets after a
154 SIGTTOU. Used internally when there was a problem during hot
155 reconfiguration.
156
157 - SIGINT and SIGTERM
158 Both signals can be used to quickly stop the daemon.
159
160 - SIGHUP
161 Dumps the status of all proxies and servers into the logs.
162 Mostly used for trouble-shooting purposes.
163
164 - SIGQUIT
165 Dumps information about memory pools into the logs. Mostly used
166 for debugging purposes.
167
168 - SIGPIPE
169 This signal is intercepted and ignored on systems without
170 MSG_NOSIGNAL.
171
172
174 A much better documentation can be found in haproxy-en.txt. On debian
175 systems, you can find this file in /usr/share/doc/haproxy/haproxy-
176 en.txt.gz.
177
178
180 HAProxy was written by Willy Tarreau. This man page was written by
181 Arnaud Cornet and Willy Tarreau.
182
183
184
185
186 17 August 2007 HAPROXY(1)