Re: Profiling PostgreSQL

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Dimitris Karampinas <dkarampin(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL mailing lists <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Profiling PostgreSQL
Date: 2014-05-23 17:57:17
Message-ID: CAMkU=1yvkeTDGrehquTnw_3sSR1VRUT3PkDQ5GjZqLU0LqtHzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, May 23, 2014 at 10:25 AM, Dimitris Karampinas
<dkarampin(at)gmail(dot)com>wrote:

> I want to bypass any disk bottleneck so I store all the data in ramfs (the
> purpose the project is to profile pg so I don't care for data loss if
> anything goes wrong).
> Since my data are memory resident, I thought the size of the shared
> buffers wouldn't play much role, yet I have to admit that I saw difference
> in performance when modifying shared_buffers parameter.
>

In which direction? If making shared_buffers larger improves things, that
suggests that you have contention on the BufFreelistLock. Increasing
shared_buffers reduces buffer churn (assuming you increase it by enough)
and so decreases that contention.

>
> I use taskset to control the number of cores that PostgreSQL is deployed
> on.
>

It can be important what bits you set. For example if you have 4 sockets,
each one with a quadcore, you would probably maximize the consequences of
spinlock contention by putting one process on each socket, rather than
putting them all on the same socket.

>
> Is there any parameter/variable in the system that is set dynamically and
> depends on the number of cores ?
>

The number of spins a spinlock goes through before sleeping,
spins_per_delay, is determined dynamically based on how often a tight loop
"pays off". But I don't think this is very sensitive to the exact number
of processors, just the difference between 1 and more than 1.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Dimitris Karampinas 2014-05-25 16:26:04 Re: Profiling PostgreSQL
Previous Message Dimitris Karampinas 2014-05-23 17:25:12 Re: Profiling PostgreSQL