Re: Too much clients connected to the PostgreSQL Database

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Too much clients connected to the PostgreSQL Database
Date: 2012-10-30 07:50:39
Message-ID: 508F86CF.7050106@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/30/12 12:32 AM, Frank Lanitz wrote:
> I was maintaining a setup which had > 1000 connections on a not very
> high-end server (12GB of Ram). It was just most of the connections were
> idling most the time. Tomcat with a high number of consistent
> connections for some reasons and end user stand alone clients which are
> establishing a database connection on startup and keeping them until
> shutdown.

a better configuration for that is for your web applications to grab a
connection from a connection pool, do a transaction, and then release
the connection as soon as you are done. keep the pool size modest,
maybe 2-4X the number of CPU cores you have. IF you have some things
that do long running queries, like for calculating reports, create a
separate smaller pool for these as there likely are only 1-2 of them at
a time anyways.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message 高健 2012-10-30 10:04:11 When sending SIGHUP to bgwriter
Previous Message Frank Lanitz 2012-10-30 07:32:15 Re: Too much clients connected to the PostgreSQL Database