Re: Too much clients connected to the PostgreSQL Database - Mailing list pgsql-general

From John R Pierce
Subject Re: Too much clients connected to the PostgreSQL Database
Date
Msg-id 508F86CF.7050106@hogranch.com
Whole thread Raw
In response to Re: Too much clients connected to the PostgreSQL Database  (Frank Lanitz <frank@frank.uvena.de>)
List 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



pgsql-general by date:

Previous
From: Frank Lanitz
Date:
Subject: Re: Too much clients connected to the PostgreSQL Database
Next
From: 高健
Date:
Subject: When sending SIGHUP to bgwriter