Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

lightweight connection pooler for PostgreSQL

NotificationsYou must be signed in to change notification settings

pgbouncer/pgbouncer

Repository files navigation

Lightweight connection pooler for PostgreSQL.

Homepage:https://www.pgbouncer.org/

Sources, bug tracking:https://github.com/pgbouncer/pgbouncer

Building

PgBouncer depends on few things to get compiled:

When dependencies are installed just run:

$ ./configure --prefix=/usr/local$ make$ make install

If you are building from Git, or are building for Windows, please seeseparate build instructions below.

DNS lookup support

PgBouncer does host name lookups at connect time instead of just onceat configuration load time. This requires an asynchronous DNSimplementation. The following table shows supported backends andtheir probing order:

backendparallelEDNS0 (1)/etc/hostsSOA lookup (2)note
c-aresyesyesyesyesIPv6+CNAME buggy in <=1.10
evdns, libevent 2.xyesnoyesnodoes not check /etc/hosts updates
getaddrinfo_a, glibc 2.9+yesyes (3)yesnoN/A on non-glibc
getaddrinfo, libcnoyes (3)yesnorequires pthreads
  1. EDNS0 is required to have more than 8 addresses behind one host name.
  2. SOA lookup is needed to re-check host names on zone serial change.
  3. To enable EDNS0, addoptions edns0 to/etc/resolv.conf.

c-ares is the most fully-featured implementation and is recommendedfor most uses and binary packaging (if a sufficiently new version isavailable). Libevent's built-in evdns is also suitable for many uses,with the listed restrictions. The other backends are mostly legacyoptions at this point and don't receive much testing anymore.

By default, c-ares is used if it can be found. Its use can be forcedwithconfigure --with-cares or disabled with--without-cares. Ifc-ares is not used (not found or disabled), then Libevent is used. Specify--disable-evdns to disable the use of Libevent's evdns and fall back to alibc-based implementation.

PAM authentication

To enable PAM authentication,./configure has a flag--with-pam(default value is no). When compiled with PAM support, a new globalauthentication typepam is available to validate users through PAM.

LDAP authentication

To enable LDAP authentication,./configure has a flag--with-ldap(default value is no). When compiled with LDAP support, a new globalauthentication typeldap is available to validate users through LDAP.

systemd integration

To enable systemd integration, use theconfigure option--with-systemd. This allows usingType=notify (orType=notify-reload ifyou are using systemd 253 or later) as well as socket activation. Seeetc/pgbouncer.service andetc/pgbouncer.socket for examples.

Building from Git

Building PgBouncer from Git requires that you generate the header andconfiguration files before you can runconfigure:

$ git clone https://github.com/pgbouncer/pgbouncer.git$ cd pgbouncer$ ./autogen.sh$ ./configure$ make$ make install

All files will be installed under/usr/local by default. You cansupply one or more command-line options toconfigure. Run./configure --help to list the available options and the environmentvariables that customizes the configuration.

Additional packages required: autoconf, automake, libtool, pandoc

Testing

See theREADME.md file in the test directory on how to run the tests.

Building on Windows

The only supported build environment on Windows is MinGW. Cygwin andVisual $ANYTHING are not supported.

To build on MinGW, do the usual:

$ ./configure$ make

If cross-compiling from Unix:

$ ./configure --host=i586-mingw32msvc

The LDAP build option is currently not supported on Windows.

Running on Windows

Running from the command line goes as usual, except that the-d (daemonize),-R (reboot), and-u (switch user) switches will not work.

To run PgBouncer as a Windows service, you need to configure theservice_name parameter to set a name for the service. Then:

$ pgbouncer -regservice config.ini

To uninstall the service:

$ pgbouncer -unregservice config.ini

To use the Windows event log, setsyslog = 1 in the configuration file.But before that, you need to registerpgbevent.dll:

$ regsvr32 pgbevent.dll

To unregister it, do:

$ regsvr32 /u pgbevent.dll

[8]ページ先頭

©2009-2025 Movatter.jp