powered by Jive Software

DB Connection Pool sizing

Hello folks,

Gato was kindly helping me with a server freezing issue earlier, and we believe that part of the issue might be related to the # of DB connections in the DB pool (we use PostgreSQL as our DB). We recently had a jump in the # of online users (to over 1200), and I had increased our DB connection pool #’‘s to minConnections = 30, and maxConnections = 55. That seems low to me still… are there any guidelines for sizing these #’'s to efficiently handle my increasing user count?

Any help would be GREATLY appreciated… we are fighting with the entrenched M$ IM solution here at my company, and these server freezes are really giving us a black eye…

BTW - Gato - sorry, no thread dump from this - it happened this morning before I got on, and our other admin is out of the office today. However, the weird thing is that it seemed to correct itself - which suggests to me that we temporarily ran out of DB connections…

Hey Guy,

Since no errors have been seen I assume that the theories of networking issues or database issues are weaker now. Since you are now mentioning that the problem has recovered after a while, I now think that in fact all your db connections in the pool were being used and you have reached the max number of connections.

I would like to add support so you can monitor the db connection pool usage and adjust the min and max quotas according to your demand based on real data. Until that feature is available you may want to increase the max connections to 100 or near the max number supported by your database (probably 500).

Regards,

– Gato

Hi Gato,

Yes, my laziness paid off here - I was asleep when the issues came up (9:00 am US Central time - 7:00 am US Pacific - my time), so for the first time, we saw the problem correct itself - we had previously always intervened when this issue arose.

Yesterday, I brought our server down for a short time, and increased the max # of available DB connections in the pool to 200 (keeping the min at 30 so we didn’'t chew up memory unnecessarily). We have a pretty beefy linux box (multi-processor Dell server with 8GB of RAM and 8GB of swap), but we are running other things on it that hit the database.

I verified that our Postgresql instance has the max DB connections set at 1000, so we should be ok for now - Friday is traditionally our lightest day in terms of usage, so I’'ll keep monitoring this and post again here if there are issues… thanks again for all your help.

-Guy