blob: 62967676580e98003df42baf9cc5302fd1001319 [file] [log] [blame]
Willy Tarreau031a26b2007-09-09 22:40:07 +02001.TH HAPROXY 1 "17 August 2007"
2
3.SH NAME
4
5HAProxy \- fast and reliable http reverse proxy and load balancer
6
7.SH SYNOPSIS
8
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +03009haproxy \-f <configuration\ file> [\-L\ <name>] [\-n\ maxconn] [\-N\ maxconn] [\-C\ <dir>] [\-v|\-vv] [\-d] [\-D] [\-q] [\-V] [\-c] [\-p\ <pidfile>] [\-s] [\-l] [\-dk] [\-ds] [\-de] [\-dp] [\-db] [\-dM[<byte>]] [\-m\ <megs>] [{\-sf|\-st}\ pidlist...]
Willy Tarreau031a26b2007-09-09 22:40:07 +020010
11.SH DESCRIPTION
12
13HAProxy is a TCP/HTTP reverse proxy which is particularly suited for
14high availability environments. Indeed, it can:
15 \- route HTTP requests depending on statically assigned cookies ;
16 \- spread the load among several servers while assuring server
17 persistence through the use of HTTP cookies ;
18 \- switch to backup servers in the event a main one fails ;
19 \- accept connections to special ports dedicated to service
20 monitoring ;
21 \- stop accepting connections without breaking existing ones ;
22 \- add/modify/delete HTTP headers both ways ;
23 \- block requests matching a particular pattern ;
24 \- hold clients to the right application server depending on
25 application cookies
26 \- report detailed status as HTML pages to authenticated users from an
27 URI intercepted from the application.
28
29It needs very little resource. Its event-driven architecture allows it
30to easily handle thousands of simultaneous connections on hundreds of
31instances without risking the system's stability.
32
33.SH OPTIONS
34
35.TP
Michael Shuler35928e82009-10-14 10:23:03 -050036\fB\-f <configuration file>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020037Specify configuration file path.
38
39.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +030040\fB\-L <name>\fP
41Set the local instance's peer name. Peers are defined in the \fBpeers\fP
42configuration section and used for syncing stick tables between different
43instances. If this option is not specified, the local hostname is used as peer
44name.
45
46.TP
Michael Shuler35928e82009-10-14 10:23:03 -050047\fB\-n <maxconn>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020048Set the high limit for the total number of simultaneous connections.
49
50.TP
Michael Shuler35928e82009-10-14 10:23:03 -050051\fB\-N <maxconn>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020052Set the high limit for the per-listener number of simultaneous connections.
53
54.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +030055\fB\-C <dir>\fP
56Change directory to <\fIdir\fP> before loading any files.
57
58.TP
59\fB\-v\fP
60Display HAProxy's version.
61
62.TP
63\fB\-vv\fP
64Display HAProxy's version and all build options.
65
66.TP
Michael Shuler35928e82009-10-14 10:23:03 -050067\fB\-d\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020068Start in foregreound with debugging mode enabled.
69When the proxy runs in this mode, it dumps every connections,
70disconnections, timestamps, and HTTP headers to stdout. This should
71NEVER be used in an init script since it will prevent the system from
72starting up.
73
74.TP
Michael Shuler35928e82009-10-14 10:23:03 -050075\fB\-D\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020076Start in daemon mode.
77
78.TP
Marc-Antoine Perennou992709b2013-02-12 10:53:52 +010079\fB\-Ds\fP
80Start in systemd daemon mode, keeping a process in foreground.
81
82.TP
Michael Shuler35928e82009-10-14 10:23:03 -050083\fB\-q\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020084Disable messages on output.
85
86.TP
Michael Shuler35928e82009-10-14 10:23:03 -050087\fB\-V\fP
88Displays messages on output even when \-q or 'quiet' are specified. Some
Willy Tarreau031a26b2007-09-09 22:40:07 +020089information about pollers and config file are displayed during startup.
90
91.TP
Michael Shuler35928e82009-10-14 10:23:03 -050092\fB\-c\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020093Only checks config file and exits with code 0 if no error was found, or
94exits with code 1 if a syntax error was found.
95
96.TP
Michael Shuler35928e82009-10-14 10:23:03 -050097\fB\-p <pidfile>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020098Ask the process to write down each of its children's pids to this file
99in daemon mode.
100
101.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500102\fB\-s\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200103Show statistics (only if compiled in).
104Statistics are only available if compiled in with the 'STATTIME' option.
105It's only used during code optimization phases, and will soon disappear.
106
107.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500108\fB\-l\fP
109Show even more statistics (implies '\-s').
Willy Tarreau031a26b2007-09-09 22:40:07 +0200110
111.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500112\fB\-dk\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300113Disable use of \fBkqueue\fP(2). \fBkqueue\fP(2) is available only on BSD systems.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200114
115.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500116\fB\-ds\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300117Disable use of speculative \fBepoll\fP(7). \fBepoll\fP(7) is available only on
118Linux 2.6 and some custom Linux 2.4 systems.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200119
120.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500121\fB\-de\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300122Disable use of \fBepoll\fP(7). \fBepoll\fP(7) is available only on Linux 2.6
Willy Tarreau031a26b2007-09-09 22:40:07 +0200123and some custom Linux 2.4 systems.
124
125.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500126\fB\-dp\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300127Disables use of \fBpoll\fP(2). \fBselect\fP(2) might be used instead.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200128
129.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300130\fB\-dS\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300131Disables use of \fBsplice\fP(2), which is broken on older kernels.
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300132
133.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500134\fB\-db\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200135Disables background mode (stays in foreground, useful for debugging).
Michael Shuler35928e82009-10-14 10:23:03 -0500136For debugging, the '\-db' option is very useful as it temporarily
Willy Tarreau031a26b2007-09-09 22:40:07 +0200137disables daemon mode and multi-process mode. The service can then be
138stopped by simply pressing Ctrl-C, without having to edit the config nor
139run full debug.
140
141.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300142\fB\-dM[<byte>]\fP
143Initializes all allocated memory areas with the given <\fIbyte\fP>. This makes
144it easier to detect bugs resulting from uninitialized memory accesses, at the
145expense of touching all allocated memory once. If <\fIbyte\fP> is not
146specified, it defaults to 0x50 (ASCII 'P').
147
148.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500149\fB\-m <megs>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200150Enforce a memory usage limit to a maximum of <megs> megabytes.
151
152.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500153\fB\-sf <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200154Send FINISH signal to the pids in pidlist after startup. The processes
155which receive this signal will wait for all sessions to finish before
156exiting. This option must be specified last, followed by any number of
157PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent.
158
159.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500160\fB\-st <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200161Send TERMINATE signal to the pids in pidlist after startup. The processes
162which receive this signal will wait immediately terminate, closing all
163active sessions. This option must be specified last, followed by any number
164of PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent.
165
166.SH LOGGING
167Since HAProxy can run inside a chroot, it cannot reliably access /dev/log.
168For this reason, it uses the UDP protocol to send its logs to the server,
169even if it is the local server. People who experience trouble receiving
170logs should ensure that their syslog daemon listens to the UDP socket.
171Several Linux distributions which ship with syslogd from the sysklogd
Michael Shuler35928e82009-10-14 10:23:03 -0500172package have UDP disabled by default. The \fB\-r\fP option must be passed
Willy Tarreau031a26b2007-09-09 22:40:07 +0200173to the daemon in order to enable UDP.
174
175.SH SIGNALS
176Some signals have a special meaning for the haproxy daemon. Generally, they are used between daemons and need not be used by the administrator.
177.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500178\- \fBSIGUSR1\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200179Tells the daemon to stop all proxies and exit once all sessions are closed. It is often referred to as the "soft-stop" signal.
180.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500181\- \fBSIGTTOU\fP
182Tells the daemon to stop listening to all sockets. Used internally by \fB\-sf\fP and \fB\-st\fP.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200183.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500184\- \fBSIGTTIN\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200185Tells the daemon to restart listening to all sockets after a \fBSIGTTOU\fP. Used internally when there was a problem during hot reconfiguration.
186.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500187\- \fBSIGINT\fP and \fBSIGTERM\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200188Both signals can be used to quickly stop the daemon.
189.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500190\- \fBSIGHUP\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200191Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes.
192.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500193\- \fBSIGQUIT\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200194Dumps information about memory pools into the logs. Mostly used for debugging purposes.
195.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500196\- \fBSIGPIPE\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200197This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP.
198
199.SH SEE ALSO
200
201A much better documentation can be found in haproxy-en.txt. On debian
202systems, you can find this file in
203/usr/share/doc/haproxy/haproxy-en.txt.gz.
204
205.SH AUTHOR
206
207HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau.
208