Re: Does this perf output seem 'normal'? - Mailing list pgsql-general

From Alex Ignatov
Subject Re: Does this perf output seem 'normal'?
Date
Msg-id 57229CBA.4030105@postgrespro.ru
Whole thread Raw
In response to Re: Does this perf output seem 'normal'?  (Peter Devoy <peter@3xe.co.uk>)
Responses Re: Does this perf output seem 'normal'?
List 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



pgsql-general by date:

Previous
From: Berend Tober
Date:
Subject: Re: "Keyed" sequence?
Next
From: Tim van der Linden
Date:
Subject: Re: Slow join over three tables