Re:Odyssey – Scalable PostgreSQL connection pooler
by cpburns2009 on Wednesday May 30, 2018 @11:18AM
(#17188343)
Do you know how pgbouncer handles an unexpected client disconnect when using session pooling? Using pgbouncer has been on my to-do list for a while and the comment by
LoSboccacc gives me some concern though it's vague.
Re:Odyssey – Scalable PostgreSQL connection pooler
by LoSboccacc on Wednesday May 30, 2018 @12:22PM
(#17189015)
I’m unsure on the specifics and it might very well be an interaction between jdbc or something, what I know is that if I change the connection reuse settings from session to transaction I get leakage and eventual exhaustion, so currently I’ve a pgbouncer in session mode on every node and connect each to the backend. That uses a little more connection on the server but for now is not critical so I haven’t investigated in deep and if easier I’d just hop to an equivalent because we’re really short on hands right now.
Re:Odyssey – Scalable PostgreSQL connection pooler
by foobarbazetc on Wednesday May 30, 2018 @02:10PM
(#17190064)
You need to make sure you turn off prepared statements if you want to use pgbouncer in transaction mode with pgjdbc.
FWIW we use it in exactly that way to serve many thousands of rps with no issues.
i tested this on my local machine and if i drop a connection while it is inside a transaction it closes the server connection.
client close:
client unexpected death: i guess it sucks that it doesn't reuse the connection but presumably this shouldn't happen that often that it would actually be a problem.