Re: [PATCH] dtrace probes for memory manager

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Greg Smith <greg(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] dtrace probes for memory manager
Date: 2009-12-11 04:55:49
Message-ID: 603c8f070912102055j2a539e40yf9a1c6f925e8972@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 9, 2009 at 9:04 AM, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com> wrote:
> Bernd Helmle píše v út 08. 12. 2009 v 22:06 +0100:
>>
>> --On 8. Dezember 2009 15:51:52 -0500 Greg Smith <greg(at)2ndquadrant(dot)com>
>> wrote:
>>
>> > Try this instead, which will give you a test where checkpoints have a
>> > minimal impact, but lots of memory will be thrown around:
>> >
>> > pgbench -i -s 10 <db>
>> > pgbench -S -c 10 -T 600 <db>
>>
>> Thanks for the input, will try....
>>
>
> I modified probes to reduce overhead. Prototype patch is attached. Main
> point is to remove mcxt_alloc probe and keep only aset_alloc. I did also
> some testing with interesting results. At first I prepare special C
> store function (attached) which do only allocation and deallocation and
> I measured how long it takes:
>
> On 32bit the memory allocation is slow down 8.4%  and on 64bit it is
> only 4.6%. Good to mention that I call palloc and pfree but in standard
> behavior pfree is not much used and memory is freed when context is
> destroyed. It means that we should think about 4.2% and 2.3% instead.
>
> But in normal situation database does also other thing and palloc is
> only one part of code path. It is why I run second test and use sun
> studio profiling tools (collect/analyzer) to determine how much CPU
> ticks cost the probes during pg_bench run. And results are much better.
> AllocSet alloc function takes about 4-5% and probes assembler code takes
> 0.1-0.2% on 64bit. I did not test 32bit but my expectation is that it
> should be about 0.3-0.4%.

There's not really enough detail here to determine what you tested and
what the results were, and I don't think this patch has any chance at
all of getting committed without that. Please clarify.

If there's some real-world test where this probe costs 0.3%-0.4%, I
think that is sufficient grounds for rejecting this patch. I
understand the desire of people to be able to use dtrace, but our
performance is too hard-won for me to want to give any measurable of
it up for tracing and instrumentation hooks that will only be used by
a small number of users in a small number of situations.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2009-12-11 04:57:27 Re: Largeobject Access Controls (r2460)
Previous Message Greg Smith 2009-12-11 04:54:17 Re: Adding support for SE-Linux security