From: | John R Pierce <pierce(at)hogranch(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Determining server load |
Date: | 2016-09-27 17:55:45 |
Message-ID: | 1beac015-29ae-a35d-a86c-4409629223ac@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2016-09-27 18:07:52 | Re: Determining server load |
Previous Message | dudedoe01 | 2016-09-27 17:04:31 | isnull() function in pgAdmin3 |