Re: Profiling PostgreSQL

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Dimitris Karampinas <dkarampin(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Profiling PostgreSQL
Date: 2014-05-23 15:13:29
Message-ID: CAFj8pRBVabR4THpcLsVk9i59SgCD8RMxYNDHg9+pgdND04Ei2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Dne 23.5.2014 16:41 "Dimitris Karampinas" <dkarampin(at)gmail(dot)com> napsal(a):
>
> Thanks for your answers. A script around pstack worked for me.
>
> (I'm not sure if I should open a new thread, I hope it's OK to ask
another question here)
>
> For the workload I run it seems that PostgreSQL scales with the number of
concurrent clients up to the point that these reach the number of cores
(more or less).
> Further increase to the number of clients leads to dramatic performance
degradation. pstack and perf show that backends block on LWLockAcquire
calls, so, someone could assume that the reason the system slows down is
because of multiple concurrent transactions that access the same data.
> However I did the two following experiments:
> 1) I completely removed the UPDATE transactions from my workload. The
throughput turned out to be better yet the trend was the same. Increasing
the number of clients, has a very negative performance impact.
> 2) I deployed PostgreSQL on more cores. The throughput improved a lot. If
the problem was due to concurrecy control, the throughput should remain the
same - no matter the number of hardware contexts.
>
> Any insight why the system behaves like this ?

Physical limits, there two possible botleneck: cpu or io. Postgres use one
cpu per session, and if you have cpu intensive benchmark, then max should
be in cpu related workers. Later a workers shares cpu, bu total throughput
should be same to cca 10xCpu (depends on test)

>
> Cheers,
> Dimitris
>
>
> On Fri, May 23, 2014 at 1:39 AM, Michael Paquier <
michael(dot)paquier(at)gmail(dot)com> wrote:
>>
>> On Thu, May 22, 2014 at 10:48 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> > Call graph data usually isn't trustworthy unless you built the program
>> > with -fno-omit-frame-pointer ...
>> This page is full of ideas as well:
>> https://wiki.postgresql.org/wiki/Profiling_with_perf
>> --
>> Michael
>
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2014-05-23 16:52:51 Re: Profiling PostgreSQL
Previous Message Dimitris Karampinas 2014-05-23 14:40:31 Re: Profiling PostgreSQL