Re: Held idle connections vs use of a Pooler

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Held idle connections vs use of a Pooler
Дата
Msg-id AANLkTim0tJGnUhgTBdYuiDRB3qc0+1jfBOwRqz9kc=G=@mail.gmail.com
обсуждение исходный текст
Ответ на Held idle connections vs use of a Pooler  (mark <dvlhntr@gmail.com>)
Список pgsql-performance
On Tue, Sep 14, 2010 at 12:10 PM, mark <dvlhntr@gmail.com> wrote:
> Hello,
>
> I am relatively new to postgres (just a few months) so apologies if
> any of you are bearing with me.
>
> I am trying to get a rough idea of the amount of bang for the buck I
> might see if I put in a connection pooling service into the enviroment
> vs our current methodology of using persistent open connections.
>
> We have a number of in house applications that connect to a central
> Postgres instance. (8.3.7). The box is admitting underpowered with
> only 8 cores, and 8gb or ram and not great disk IO out of an MSA-70.
> the database is about 35GB on disk and does mainly (~95%) OTLP type
> queries. I am currently begging for more ram.
>
> Most of the connections from the various apps hold idle connections
> until they need to execute a query once done go back to holding an
> open idle connection.  (there are ~600 open connections at any given
> time, and most of the time most are idle)

This is IMO a strong justification for a connection pooler.  Certain
classes of problems will go away and you will have a more responsive
server under high load conditions.

> this is typically fine while the number of active queries is low, but
> some other application (that doesn't use connection pooling or holding
> open connections when not in use) is hitting the db from time to time
> with 50-100 small queries (2ms queries from my testing) nearly all at
> once. when this happens the whole response time goes out the door
> however).
>
>
> I think from reading this list for a few weeks the answer is move to
> using connection pooling package elsewhere to better manage incoming
> connections, with a lower number to the db.
>
> I am told this will require some re-working of some app code as I
> understand pg-pool was tried a while back in our QA environment and
> server parts of various in-house apps/scripts/..etc started to
> experience show stopping problems.

What types of problems did you have?  Performance related or bugs
stemming from changes in the way your pooler runs the queries?  What
kind of session level objects (like prepared statements) do you rely
on? The answer to this question will affect the feasibility of using a
pooler, or which one you use.  pgbouncer in transaction mode is a
great choice if you can live under the restrictions -- it's almost
completely transparent.  pgpool I'm not nearly as familiar with.

> to help make my case to the devs and various managers I was wondering
> if someone could expand on what extra work is having to be done while
> queries run and there is a high (500-600) number of open yet idle
> connections to db. lots of the queries executed use sub-transactions
> if that makes a difference.

General note: queries with subtransactions (savepoints or pl/pgsql
exception handlers) are much more expensive than those without.   I
would maybe be trying to batch work in your load spike somehow or
working it so that retries are done in the app vs the database.

merlin

В списке pgsql-performance по дате отправления:

Предыдущее
От: Dave Crooke
Дата:
Сообщение: Re: Useless sort by
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Held idle connections vs use of a Pooler