Re: profiling pgbench

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Subject: Re: profiling pgbench
Date: 2010-11-24 22:38:27
Message-ID: 201011242338.27584.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday 24 November 2010 23:34:46 Robert Haas wrote:
> On Wed, Nov 24, 2010 at 5:33 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> > On Wed, Nov 24, 2010 at 1:19 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> >> On Wednesday 24 November 2010 22:14:04 Andres Freund wrote:
> >>> On Wednesday 24 November 2010 21:24:43 Robert Haas wrote:
> >>>
> >>> Recarding LWLockAcquire costs:
> >>> Yes, its pretty noticeable - on loads of different usages. On a bunch
> >>> of production machines its the second (begind XLogInsert) on some the
> >>> most expensive function. Most of the time
> >>
> >> AllocSetAlloc is the third, battling with hash_search_with_hash value.
> >> To complete that sentence...
> >
> > I've played a bit with hash_search_with_hash_value and found that most
> > of the time is spent on shared hash tables, not private ones. And the
> > time attributed to it for the shared hash tables mostly seems to be
> > due to the time it takes to fight cache lines away from other CPUs. I
> > suspect the same thing is true of LWLockAcquire.
>
> How do you get stats on that?
Btw, if you have some recent kernel I would try to use perf - I find the event
mappings easier to understand there, but maybe thats just me jumping onto
bandwagons.

> How big is a typical cache line on modern CPUs?
for the line size
cat /sys/devices/system/cpu/cpu0/cache/index*/coherency_line_size

for the overall size
cat /sys/devices/system/cpu/cpu0/cache/index*/size

Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-11-24 22:42:58 Re: profiling connection overhead
Previous Message Robert Haas 2010-11-24 22:34:46 Re: profiling pgbench