Re: Determining server load - Mailing list pgsql-general

From John R Pierce
Subject Re: Determining server load
Date
Msg-id 1beac015-29ae-a35d-a86c-4409629223ac@hogranch.com
Whole thread Raw
In response to Determining server load  (Israel Brewster <israel@ravnalaska.net>)
Responses Re: Determining server load  (Israel Brewster <israel@ravnalaska.net>)
List pgsql-general
On 9/27/2016 9:54 AM, Israel Brewster wrote:
>
> I did look at pgbadger, which tells me I have gotten as high as 62
> connections/second, but given that most of those connections are
> probably very short lived that doesn't really tell me anything about
> concurrent connections.

Each connection requires a process fork of the database server, which is
very expensive.  you might consider using a connection pool such as
pgbouncer, to maintain a fixed(dynamic) number of real database
connections, and have your apps connect/disconnect to this pool.
Obviously, you need a pool for each database, and your apps need to be
'stateless' and not make or rely on any session changes to the
connection so they don't interfere with each other.   Doing this
correctly can make an huge performance improvement on the sort of apps
that do (connect, transaction, disconnect) a lot.



--
john r pierce, recycling bits in santa cruz



pgsql-general by date:

Previous
From: Israel Brewster
Date:
Subject: Determining server load
Next
From: Adrian Klaver
Date:
Subject: Re: Determining server load