Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 649
StarTrekFan Avatar asked Oct 29 '22 08:10

StarTrekFan


1 Answers

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

like image 152
NovasPython Avatar answered Nov 15 '22 06:11

NovasPython