Code Monkey home page Code Monkey logo

pgbouncer's Introduction

PgBouncer

Lightweight connection pooler for PostgreSQL.

Homepage
https://pgbouncer.github.io
Sources, bugtracking
https://github.com/pgbouncer/pgbouncer

Building

PgBouncer depends on few things to get compiled:

When dependencies are installed just run:

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

If you are building from git, or are building for Windows, please see separate build instructions below.

DNS lookup support

Starting from PgBouncer 1.4, it does hostname lookups at connect time instead just once at config load time. This requires proper async DNS implementation. Following list shows supported backends and their probing order:

backend parallel EDNS0 (1) /etc/hosts SOA lookup (2) note
c-ares yes yes yes yes ipv6+CNAME buggy in <=1.10
udns yes yes no yes ipv4-only
evdns, libevent 2.x yes no yes no does not check /etc/hosts updates
getaddrinfo_a, glibc 2.9+ yes yes (3) yes no N/A on non-linux
getaddrinfo, libc no yes (3) yes no N/A on win32, requires pthreads
evdns, libevent 1.x yes no no no buggy
  1. EDNS0 is required to have more than 8 addresses behind one hostname.
  2. SOA lookup is needed to re-check hostnames on zone serial change
  3. To enable EDNS0, add options edns0 to /etc/resolv.conf

./configure also has flags --enable-evdns and --disable-evdns which turn off automatic probing and force use of either evdns or getaddrinfo_a().

Building from GIT

Building PgBouncer from GIT requires that you fetch libusual submodule and generate the header and config files before you can run configure:

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

Additional packages required: autoconf, automake, libtool, autoconf-archive, python-docutils, and pkg-config.

Building for WIN32

At the moment only build env tested is MINGW32 / MSYS. Cygwin and Visual $ANYTHING are untested. Libevent 2.x is required for DNS hostname lookup.

Then do the usual:

$ ./configure ...
$ make

If cross-compiling from Unix:

$ ./configure --host=i586-mingw32msvc ...

Running on WIN32

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

To run pgbouncer as a Windows service, you need to configure service_name parameter to set name for service. Then:

$ pgbouncer -regservice config.ini

To uninstall service:

$ pgbouncer -unregservice config.ini

To use Windows Event Log, set "syslog = 1" in config file. But before you need to register pgbevent.dll:

$ regsvr32 pgbevent.dll

To unregister it, do:

$ regsvr32 /u pgbevent.dll

pgbouncer's People

Contributors

adunstan avatar bobpoekert avatar ccutrer avatar eradman avatar gleu avatar guillaumeaubert avatar markokr avatar mfenniak avatar mhagander avatar mtharp avatar okbob avatar olshevskiy87 avatar petere avatar pjmodos avatar toofishes avatar wgrant avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.