Search code examples
postgresqlpgbouncer

Pgbouncer log shows only 0 req/s


It's my first stackoverflow post so I wanted so say hi! ;)

I have question regarding pgbouncer. I just started using that together with my django app and postgres. I though everything is set up correctly, but I get only such information in log:

"LOG Stats: 0 req/s, in 0 b/s, out 0 b/s"

It seems like it is not running, or do I miss its concept? There are no other errors, except of those stat lines with just 0s. The app is constantly running with tens of people using it every second, making database connections, so there should be something logged right? Do you have any clue why this could happen? Thanks!


Solution

  • pgbouncer listens on e.g. port 6543 and your postgres db on port 5543. Your application has to connect to pgbouncer not to the postgres database.

    your_app -> pgbouncer -> postgres

    Just edit the app config and add the port of pgbouncer, here 6543. Of course your /etc/pgbouncer/pgbouncer.ini should contain the postgres database port 5543.

    You can find a useful documentation here: pgbouncer docu