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