Re: connections slowing everything down?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: connections slowing everything down?
Дата
Msg-id b42b73150804221746v757c5450p265d66f20b9a4d38@mail.gmail.com
обсуждение исходный текст
Ответ на connections slowing everything down?  (Adrian Moisey <adrian@careerjunction.co.za>)
Список pgsql-performance
On Mon, Apr 21, 2008 at 5:50 AM, Adrian Moisey
<adrian@careerjunction.co.za> wrote:
> Hi
>
>  # ps -ef | grep idle | wc -l
>  87
>  # ps -ef | grep SELECT | wc -l
>  5
>
>
>  I have 2 web servers which connect to PGPool which connects to our postgres
> db.  I have noticed that idle connections seem to take up CPU and RAM
> (according to top).  Could this in any way cause things to slow down?

Something is not quite with your assumptions. On an unloaded server,
open a bunch of connections (like 500) from psql doing nothing, and
cpu load will stay at zero. IOW, an 'idle' connection does not consume
any measurable CPU resources once connected.  It does consume some ram
but that would presumably at least partly swap out eventually.  What's
probably going on here is your connections are not really idle.  Top
by default aggregates usage every three seconds and ps is more of a
snapshot.  During the top a single connection might accept and dispose
0, 1, 50, 100, or 1000 queries depending on various factors.  Your
sampling methods are simply not accurate enough.

With statement level logging on (with pid on the log line),  you can
break out and measure query activity by connection.

merlin

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

Предыдущее
От: Ivan Voras
Дата:
Сообщение: Re: CPU bound at 99%
Следующее
От: Shane Ambler
Дата:
Сообщение: Re: [PERFORMANCE] Error loading 37G CSV file "invalid string enlargement request size 65536"