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 |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 60 | \fB\-q\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 61 | Disable messages on output. |
| 62 | |
| 63 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 64 | \fB\-V\fP |
| 65 | Displays messages on output even when \-q or 'quiet' are specified. Some |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 66 | information about pollers and config file are displayed during startup. |
| 67 | |
| 68 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 69 | \fB\-c\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 70 | Only checks config file and exits with code 0 if no error was found, or |
| 71 | exits with code 1 if a syntax error was found. |
| 72 | |
| 73 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 74 | \fB\-p <pidfile>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 75 | Ask the process to write down each of its children's pids to this file |
| 76 | in daemon mode. |
| 77 | |
| 78 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 79 | \fB\-s\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 80 | Show statistics (only if compiled in). |
| 81 | Statistics are only available if compiled in with the 'STATTIME' option. |
| 82 | It's only used during code optimization phases, and will soon disappear. |
| 83 | |
| 84 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 85 | \fB\-l\fP |
| 86 | Show even more statistics (implies '\-s'). |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 87 | |
| 88 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 89 | \fB\-dk\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 90 | Disable use of kqueue(). kqueue() is available only on BSD systems. |
| 91 | |
| 92 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 93 | \fB\-ds\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 94 | Disable use of speculative epoll(). epoll() is available only on Linux 2.6 |
| 95 | and some custom Linux 2.4 systems. |
| 96 | |
| 97 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 98 | \fB\-de\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 99 | Disable use of epoll(). epoll() is available only on Linux 2.6 |
| 100 | and some custom Linux 2.4 systems. |
| 101 | |
| 102 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 103 | \fB\-dp\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 104 | Disables use of poll(). select() might be used instead. |
| 105 | |
| 106 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 107 | \fB\-db\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 108 | Disables background mode (stays in foreground, useful for debugging). |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 109 | For debugging, the '\-db' option is very useful as it temporarily |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 110 | disables daemon mode and multi-process mode. The service can then be |
| 111 | stopped by simply pressing Ctrl-C, without having to edit the config nor |
| 112 | run full debug. |
| 113 | |
| 114 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 115 | \fB\-m <megs>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 116 | Enforce a memory usage limit to a maximum of <megs> megabytes. |
| 117 | |
| 118 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 119 | \fB\-sf <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 120 | Send FINISH signal to the pids in pidlist after startup. The processes |
| 121 | which receive this signal will wait for all sessions to finish before |
| 122 | exiting. This option must be specified last, followed by any number of |
| 123 | PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent. |
| 124 | |
| 125 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 126 | \fB\-st <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 127 | Send TERMINATE signal to the pids in pidlist after startup. The processes |
| 128 | which receive this signal will wait immediately terminate, closing all |
| 129 | active sessions. This option must be specified last, followed by any number |
| 130 | of PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent. |
| 131 | |
| 132 | .SH LOGGING |
| 133 | Since HAProxy can run inside a chroot, it cannot reliably access /dev/log. |
| 134 | For this reason, it uses the UDP protocol to send its logs to the server, |
| 135 | even if it is the local server. People who experience trouble receiving |
| 136 | logs should ensure that their syslog daemon listens to the UDP socket. |
| 137 | Several Linux distributions which ship with syslogd from the sysklogd |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 138 | 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] | 139 | to the daemon in order to enable UDP. |
| 140 | |
| 141 | .SH SIGNALS |
| 142 | Some signals have a special meaning for the haproxy daemon. Generally, they are used between daemons and need not be used by the administrator. |
| 143 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 144 | \- \fBSIGUSR1\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 145 | Tells the daemon to stop all proxies and exit once all sessions are closed. It is often referred to as the "soft-stop" signal. |
| 146 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 147 | \- \fBSIGTTOU\fP |
| 148 | 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] | 149 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 150 | \- \fBSIGTTIN\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 151 | Tells the daemon to restart listening to all sockets after a \fBSIGTTOU\fP. Used internally when there was a problem during hot reconfiguration. |
| 152 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 153 | \- \fBSIGINT\fP and \fBSIGTERM\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 154 | Both signals can be used to quickly stop the daemon. |
| 155 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 156 | \- \fBSIGHUP\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 157 | Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes. |
| 158 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 159 | \- \fBSIGQUIT\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 160 | Dumps information about memory pools into the logs. Mostly used for debugging purposes. |
| 161 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 162 | \- \fBSIGPIPE\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 163 | This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP. |
| 164 | |
| 165 | .SH SEE ALSO |
| 166 | |
| 167 | A much better documentation can be found in haproxy-en.txt. On debian |
| 168 | systems, you can find this file in |
| 169 | /usr/share/doc/haproxy/haproxy-en.txt.gz. |
| 170 | |
| 171 | .SH AUTHOR |
| 172 | |
| 173 | HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau. |
| 174 | |