HNHacker News
TopNewBestAskShowJobs

_hans_

18 karma · joined February 19, 2014

hans.io
submissionscomments
_hans_··on Costs of a PostgreSQL connection
We do have this problem! It is only a matter of how small the PGBouncer machine is compared to the PostgreSQL. In our case the PGBouncer had to deal with 16000 req/s, coming from 700 clients going through 100 connections to the PostgreSQL. We now have 4 PGBouncers for this DB, and we're 'load balancing' them with DNS.
_hans_··on Costs of a PostgreSQL connection
Thank you. We configured the system to accept more file descriptors. I think our issue was caused by something else.
_hans_··on Costs of a PostgreSQL connection
Neither AWS RDS PostgreSQL nor Heroku has a PGBouncer.
_hans_··on Costs of a PostgreSQL connection
There was no apparent problem with turning it off for us. But maybe there is for others.
_hans_··on Costs of a PostgreSQL connection
Yes you're right, idle connection do not use temp_buffers or work_mem.

I was trying to gather everything relevant to resources per connection. I'm not saying work_mem caused our problem.

_hans_··on Costs of a PostgreSQL connection
We enabled PGBouncer transaction mode and had to set 'prepared_statements: false' in our database.yml b/c the transaction mode doesn't support that. Works fine for us.
_hans_··on Costs of a PostgreSQL connection
Thanks for your comment!

Re work_mem: I think this is per query and thus might affect every connection?! At least thats what I gather from 'PostgreSQL 9.0 High Performance' Re temp_buffers: 'Sets the maximum number of temporary buffers used by each database session.' For us it practically means per connection. Not for you?

Shit, I'm missing the version! 9.3. I edited the blog post.

Re memory: I think that really depends on the application I think. We have many idle connections.