5 Lightweight connection pooler for PostgreSQL.
7 Homepage: <https://pgbouncer.github.io>
9 Sources, bugtracking: <https://github.com/pgbouncer/pgbouncer>
14 PgBouncer depends on few things to get compiled:
19 * [OpenSSL] 1.0.1 for TLS support.
20 * (optional) [c-ares] as alternative to libevent's evdns.
22 [GNU Make]: https://www.gnu.org/software/make/
23 [libevent]: http://libevent.org/
24 [pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/
25 [OpenSSL]: https://www.openssl.org/
26 [c-ares]: http://c-ares.haxx.se/
28 When dependencies are installed just run:
30 $ ./configure --prefix=/usr/local
34 If you are building from Git, or are building for Windows, please see
35 separate build instructions below.
40 PgBouncer does host name lookups at connect time instead of just once
41 at configuration load time. This requires an asynchronous DNS
42 implementation. The following table shows supported backends and
45 | backend | parallel | EDNS0 (1) | /etc/hosts | SOA lookup (2) | note |
46 |----------------------------|----------|-----------|------------|----------------|---------------------------------------|
47 | c-ares | yes | yes | yes | yes | IPv6+CNAME buggy in <=1.10 |
48 | udns | yes | yes | no | yes | IPv4 only |
49 | evdns, libevent 2.x | yes | no | yes | no | does not check /etc/hosts updates |
50 | getaddrinfo_a, glibc 2.9+ | yes | yes (3) | yes | no | N/A on non-glibc |
51 | getaddrinfo, libc | no | yes (3) | yes | no | N/A on Windows, requires pthreads |
53 1. EDNS0 is required to have more than 8 addresses behind one host name.
54 2. SOA lookup is needed to re-check host names on zone serial change.
55 3. To enable EDNS0, add `options edns0` to `/etc/resolv.conf`.
57 c-ares is the most fully-featured implementation and is recommended
58 for most uses and binary packaging (if a sufficiently new version is
59 available). libevent's built-in evdns is also suitable for many uses,
60 with the listed restrictions. The other backends are mostly legacy
61 options at this point and don't receive much testing anymore.
63 By default, c-ares is used if it can be found. Its use can be forced
64 with `configure --with-cares` or disabled with `--without-cares`. If
65 c-ares is not used (not found or disabled), then specify `--with-udns`
66 to pick udns, else libevent is used. Specify `--disable-evdns` to
67 disable the use of libevent's evdns and fall back to a libc-based
73 To enable PAM authentication `./configure` has a flag `--with-pam` (default value is no). When compiled with
74 PAM support new global authentication type `pam` appears which can be used to validate users through PAM.
79 Building PgBouncer from Git requires that you fetch libusual
80 submodule and generate the header and config files before
81 you can run configure:
83 $ git clone https://github.com/pgbouncer/pgbouncer.git
86 $ git submodule update
92 Additional packages required: autoconf, automake, libtool, pandoc
97 The only supported build environment on Windows is MinGW. Cygwin and
98 Visual $ANYTHING are not supported.
100 To build on MinGW, do the usual:
105 If cross-compiling from Unix:
107 $ ./configure --host=i586-mingw32msvc ...
112 Running from command-line goes as usual, except that the -d (daemonize),
113 -R (reboot) and -u (switch user) switches will not work.
115 To run pgbouncer as a Windows service, you need to configure the
116 `service_name` parameter to set name for service. Then:
118 $ pgbouncer -regservice config.ini
120 To uninstall service:
122 $ pgbouncer -unregservice config.ini
124 To use Windows Event Log, set "syslog = 1" in config file.
125 But before you need to register pgbevent.dll:
127 $ regsvr32 pgbevent.dll
129 To unregister it, do:
131 $ regsvr32 /u pgbevent.dll