_hans_
Re:Costs of a PostgreSQL connection
on Thursday February 20, 2014 @12:19AM (#7269030)
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.
Re:Costs of a PostgreSQL connection
on Wednesday February 19, 2014 @02:47PM (#7265760)
Thank you. We configured the system to accept more file descriptors. I think our issue was caused by something else.
Re:Costs of a PostgreSQL connection
on Wednesday February 19, 2014 @02:37PM (#7265693)
Neither AWS RDS PostgreSQL nor Heroku has a PGBouncer.
Re:Costs of a PostgreSQL connection
on Wednesday February 19, 2014 @12:24PM (#7264722)
There was no apparent problem with turning it off for us. But maybe there is for others.
Re:Costs of a PostgreSQL connection
on Wednesday February 19, 2014 @12:22PM (#7264707)
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.
Re:Costs of a PostgreSQL connection
on Wednesday February 19, 2014 @10:52AM (#7264171)
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.
Re:Costs of a PostgreSQL connection
on Wednesday February 19, 2014 @10:50AM (#7264164)
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.