blob: 48717adefab4f61e9fbf594d01e7651127623daf [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
Michael Shuler35928e82009-10-14 10:23:03 -05009haproxy \-f <configuration\ file> [\-n\ maxconn] [\-N\ maxconn] [\-d] [\-D] [\-q] [\-V] [\-c] [\-p\ <pidfile>] [\-s] [\-l] [\-dk] [\-ds] [\-de] [\-dp] [\-db] [\-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
Michael Shuler35928e82009-10-14 10:23:03 -050040\fB\-n <maxconn>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020041Set the high limit for the total number of simultaneous connections.
42
43.TP
Michael Shuler35928e82009-10-14 10:23:03 -050044\fB\-N <maxconn>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020045Set the high limit for the per-listener number of simultaneous connections.
46
47.TP
Michael Shuler35928e82009-10-14 10:23:03 -050048\fB\-d\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020049Start in foregreound with debugging mode enabled.
50When the proxy runs in this mode, it dumps every connections,
51disconnections, timestamps, and HTTP headers to stdout. This should
52NEVER be used in an init script since it will prevent the system from
53starting up.
54
55.TP
Michael Shuler35928e82009-10-14 10:23:03 -050056\fB\-D\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020057Start in daemon mode.
58
59.TP
Marc-Antoine Perennou992709b2013-02-12 10:53:52 +010060\fB\-Ds\fP
61Start in systemd daemon mode, keeping a process in foreground.
62
63.TP
Michael Shuler35928e82009-10-14 10:23:03 -050064\fB\-q\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020065Disable messages on output.
66
67.TP
Michael Shuler35928e82009-10-14 10:23:03 -050068\fB\-V\fP
69Displays messages on output even when \-q or 'quiet' are specified. Some
Willy Tarreau031a26b2007-09-09 22:40:07 +020070information about pollers and config file are displayed during startup.
71
72.TP
Michael Shuler35928e82009-10-14 10:23:03 -050073\fB\-c\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020074Only checks config file and exits with code 0 if no error was found, or
75exits with code 1 if a syntax error was found.
76
77.TP
Michael Shuler35928e82009-10-14 10:23:03 -050078\fB\-p <pidfile>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020079Ask the process to write down each of its children's pids to this file
80in daemon mode.
81
82.TP
Michael Shuler35928e82009-10-14 10:23:03 -050083\fB\-s\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020084Show statistics (only if compiled in).
85Statistics are only available if compiled in with the 'STATTIME' option.
86It's only used during code optimization phases, and will soon disappear.
87
88.TP
Michael Shuler35928e82009-10-14 10:23:03 -050089\fB\-l\fP
90Show even more statistics (implies '\-s').
Willy Tarreau031a26b2007-09-09 22:40:07 +020091
92.TP
Michael Shuler35928e82009-10-14 10:23:03 -050093\fB\-dk\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020094Disable use of kqueue(). kqueue() is available only on BSD systems.
95
96.TP
Michael Shuler35928e82009-10-14 10:23:03 -050097\fB\-ds\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020098Disable use of speculative epoll(). epoll() is available only on Linux 2.6
99and some custom Linux 2.4 systems.
100
101.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500102\fB\-de\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200103Disable use of epoll(). epoll() is available only on Linux 2.6
104and some custom Linux 2.4 systems.
105
106.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500107\fB\-dp\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200108Disables use of poll(). select() might be used instead.
109
110.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500111\fB\-db\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200112Disables background mode (stays in foreground, useful for debugging).
Michael Shuler35928e82009-10-14 10:23:03 -0500113For debugging, the '\-db' option is very useful as it temporarily
Willy Tarreau031a26b2007-09-09 22:40:07 +0200114disables daemon mode and multi-process mode. The service can then be
115stopped by simply pressing Ctrl-C, without having to edit the config nor
116run full debug.
117
118.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500119\fB\-m <megs>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200120Enforce a memory usage limit to a maximum of <megs> megabytes.
121
122.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500123\fB\-sf <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200124Send FINISH signal to the pids in pidlist after startup. The processes
125which receive this signal will wait for all sessions to finish before
126exiting. This option must be specified last, followed by any number of
127PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent.
128
129.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500130\fB\-st <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200131Send TERMINATE signal to the pids in pidlist after startup. The processes
132which receive this signal will wait immediately terminate, closing all
133active sessions. This option must be specified last, followed by any number
134of PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent.
135
136.SH LOGGING
137Since HAProxy can run inside a chroot, it cannot reliably access /dev/log.
138For this reason, it uses the UDP protocol to send its logs to the server,
139even if it is the local server. People who experience trouble receiving
140logs should ensure that their syslog daemon listens to the UDP socket.
141Several Linux distributions which ship with syslogd from the sysklogd
Michael Shuler35928e82009-10-14 10:23:03 -0500142package have UDP disabled by default. The \fB\-r\fP option must be passed
Willy Tarreau031a26b2007-09-09 22:40:07 +0200143to the daemon in order to enable UDP.
144
145.SH SIGNALS
146Some signals have a special meaning for the haproxy daemon. Generally, they are used between daemons and need not be used by the administrator.
147.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500148\- \fBSIGUSR1\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200149Tells the daemon to stop all proxies and exit once all sessions are closed. It is often referred to as the "soft-stop" signal.
150.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500151\- \fBSIGTTOU\fP
152Tells 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 +0200153.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500154\- \fBSIGTTIN\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200155Tells the daemon to restart listening to all sockets after a \fBSIGTTOU\fP. Used internally when there was a problem during hot reconfiguration.
156.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500157\- \fBSIGINT\fP and \fBSIGTERM\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200158Both signals can be used to quickly stop the daemon.
159.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500160\- \fBSIGHUP\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200161Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes.
162.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500163\- \fBSIGQUIT\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200164Dumps information about memory pools into the logs. Mostly used for debugging purposes.
165.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500166\- \fBSIGPIPE\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200167This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP.
168
169.SH SEE ALSO
170
171A much better documentation can be found in haproxy-en.txt. On debian
172systems, you can find this file in
173/usr/share/doc/haproxy/haproxy-en.txt.gz.
174
175.SH AUTHOR
176
177HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau.
178