Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 1 | .TH HAPROXY 1 "17 August 2007" |
| 2 | |
| 3 | .SH NAME |
| 4 | |
| 5 | HAProxy \- fast and reliable http reverse proxy and load balancer |
| 6 | |
| 7 | .SH SYNOPSIS |
| 8 | |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 9 | haproxy \-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 Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 10 | |
| 11 | .SH DESCRIPTION |
| 12 | |
| 13 | HAProxy is a TCP/HTTP reverse proxy which is particularly suited for |
| 14 | high 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 | |
| 29 | It needs very little resource. Its event-driven architecture allows it |
| 30 | to easily handle thousands of simultaneous connections on hundreds of |
| 31 | instances without risking the system's stability. |
| 32 | |
| 33 | .SH OPTIONS |
| 34 | |
| 35 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 36 | \fB\-f <configuration file>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 37 | Specify configuration file path. |
| 38 | |
| 39 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 40 | \fB\-n <maxconn>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 41 | Set the high limit for the total number of simultaneous connections. |
| 42 | |
| 43 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 44 | \fB\-N <maxconn>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 45 | Set the high limit for the per-listener number of simultaneous connections. |
| 46 | |
| 47 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 48 | \fB\-d\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 49 | Start in foregreound with debugging mode enabled. |
| 50 | When the proxy runs in this mode, it dumps every connections, |
| 51 | disconnections, timestamps, and HTTP headers to stdout. This should |
| 52 | NEVER be used in an init script since it will prevent the system from |
| 53 | starting up. |
| 54 | |
| 55 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 56 | \fB\-D\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 57 | Start in daemon mode. |
| 58 | |
| 59 | .TP |
Marc-Antoine Perennou | 992709b | 2013-02-12 10:53:52 +0100 | [diff] [blame] | 60 | \fB\-Ds\fP |
| 61 | Start in systemd daemon mode, keeping a process in foreground. |
| 62 | |
| 63 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 64 | \fB\-q\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 65 | Disable messages on output. |
| 66 | |
| 67 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 68 | \fB\-V\fP |
| 69 | Displays messages on output even when \-q or 'quiet' are specified. Some |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 70 | information about pollers and config file are displayed during startup. |
| 71 | |
| 72 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 73 | \fB\-c\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 74 | Only checks config file and exits with code 0 if no error was found, or |
| 75 | exits with code 1 if a syntax error was found. |
| 76 | |
| 77 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 78 | \fB\-p <pidfile>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 79 | Ask the process to write down each of its children's pids to this file |
| 80 | in daemon mode. |
| 81 | |
| 82 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 83 | \fB\-s\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 84 | Show statistics (only if compiled in). |
| 85 | Statistics are only available if compiled in with the 'STATTIME' option. |
| 86 | It's only used during code optimization phases, and will soon disappear. |
| 87 | |
| 88 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 89 | \fB\-l\fP |
| 90 | Show even more statistics (implies '\-s'). |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 91 | |
| 92 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 93 | \fB\-dk\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 94 | Disable use of kqueue(). kqueue() is available only on BSD systems. |
| 95 | |
| 96 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 97 | \fB\-ds\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 98 | Disable use of speculative epoll(). epoll() is available only on Linux 2.6 |
| 99 | and some custom Linux 2.4 systems. |
| 100 | |
| 101 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 102 | \fB\-de\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 103 | Disable use of epoll(). epoll() is available only on Linux 2.6 |
| 104 | and some custom Linux 2.4 systems. |
| 105 | |
| 106 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 107 | \fB\-dp\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 108 | Disables use of poll(). select() might be used instead. |
| 109 | |
| 110 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 111 | \fB\-db\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 112 | Disables background mode (stays in foreground, useful for debugging). |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 113 | For debugging, the '\-db' option is very useful as it temporarily |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 114 | disables daemon mode and multi-process mode. The service can then be |
| 115 | stopped by simply pressing Ctrl-C, without having to edit the config nor |
| 116 | run full debug. |
| 117 | |
| 118 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 119 | \fB\-m <megs>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 120 | Enforce a memory usage limit to a maximum of <megs> megabytes. |
| 121 | |
| 122 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 123 | \fB\-sf <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 124 | Send FINISH signal to the pids in pidlist after startup. The processes |
| 125 | which receive this signal will wait for all sessions to finish before |
| 126 | exiting. This option must be specified last, followed by any number of |
| 127 | PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent. |
| 128 | |
| 129 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 130 | \fB\-st <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 131 | Send TERMINATE signal to the pids in pidlist after startup. The processes |
| 132 | which receive this signal will wait immediately terminate, closing all |
| 133 | active sessions. This option must be specified last, followed by any number |
| 134 | of PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent. |
| 135 | |
| 136 | .SH LOGGING |
| 137 | Since HAProxy can run inside a chroot, it cannot reliably access /dev/log. |
| 138 | For this reason, it uses the UDP protocol to send its logs to the server, |
| 139 | even if it is the local server. People who experience trouble receiving |
| 140 | logs should ensure that their syslog daemon listens to the UDP socket. |
| 141 | Several Linux distributions which ship with syslogd from the sysklogd |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 142 | package have UDP disabled by default. The \fB\-r\fP option must be passed |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 143 | to the daemon in order to enable UDP. |
| 144 | |
| 145 | .SH SIGNALS |
| 146 | Some 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 Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 148 | \- \fBSIGUSR1\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 149 | Tells 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 Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 151 | \- \fBSIGTTOU\fP |
| 152 | Tells the daemon to stop listening to all sockets. Used internally by \fB\-sf\fP and \fB\-st\fP. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 153 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 154 | \- \fBSIGTTIN\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 155 | Tells 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 Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 157 | \- \fBSIGINT\fP and \fBSIGTERM\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 158 | Both signals can be used to quickly stop the daemon. |
| 159 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 160 | \- \fBSIGHUP\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 161 | Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes. |
| 162 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 163 | \- \fBSIGQUIT\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 164 | Dumps information about memory pools into the logs. Mostly used for debugging purposes. |
| 165 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 166 | \- \fBSIGPIPE\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 167 | This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP. |
| 168 | |
| 169 | .SH SEE ALSO |
| 170 | |
| 171 | A much better documentation can be found in haproxy-en.txt. On debian |
| 172 | systems, you can find this file in |
| 173 | /usr/share/doc/haproxy/haproxy-en.txt.gz. |
| 174 | |
| 175 | .SH AUTHOR |
| 176 | |
| 177 | HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau. |
| 178 | |