Re: Does this perf output seem 'normal'?

From: Alex Ignatov <a(dot)ignatov(at)postgrespro(dot)ru>
To: Peter Devoy <peter(at)3xe(dot)co(dot)uk>
Cc: "Psql_General (E-mail)" <pgsql-general(at)postgresql(dot)org>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Subject: Re: Does this perf output seem 'normal'?
Date: 2016-04-28 23:28:58
Message-ID: 57229CBA.4030105@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 28.04.2016 17:50, Peter Devoy wrote:
>> Also do you know that in perf report second column is the total cpu time share and not the first
> Thank you, I did notice they did not add up -- that makes more sense now.
>
>> Can you expand node from perf report
> Yes, my pleasure. I added "--call-graph fractal,2,callee" to the
> command, hopefully it seems more useful:
>
> https://cloud.githubusercontent.com/assets/4375326/14889937/a1378982-0d58-11e6-89b6-aac5e1620fbb.png
>
> To my amateur eye it seems like there is suspicious amount of memory &
> thread management going on...?
>
>
> --
> Peter
Or this report is much more infomative and it is looks healthy =)!
At first glance i see that postgres is simply forking i.e. spawning
child process for the new session. Creating new PG connection is slow
process, even if your select is light fast total response time can be
very long.

Have you ever heard about pgbouncer- the light Postgres connection
pooler? It is placed between you app server and pg and proxing app
server queries to pg server. pgbouncer have some constant number of
connections to pg server and have some sort of queue on incoming
connection from app server.

TL;DR Use pgbouncer between app server and Postgres =)

Alex Ignatov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim van der Linden 2016-04-29 00:19:11 Re: Slow join over three tables
Previous Message Berend Tober 2016-04-28 22:57:02 Re: "Keyed" sequence?