Re: pg_stat_lwlocks view - lwlocks statistics, round 2 - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: pg_stat_lwlocks view - lwlocks statistics, round 2
Date
Msg-id CAHGQGwHAXrYSHbRx1niopimxSe4MvJseDmUWcoo=m8y83PAEgA@mail.gmail.com
Whole thread Raw
In response to Re: pg_stat_lwlocks view - lwlocks statistics, round 2  (Satoshi Nagayasu <snaga@uptime.jp>)
Responses Re: pg_stat_lwlocks view - lwlocks statistics, round 2  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Sat, Oct 13, 2012 at 11:34 PM, Satoshi Nagayasu <snaga@uptime.jp> wrote:
> Hi,
>
> 2012/10/13 23:05, Satoshi Nagayasu wrote:
>> Hi all,
>>
>> I have fixed my previous patch for pg_stat_lwlocks view, and
>> as Josh commented, it now supports local and global (shared)
>> statistics in the same system view.
>
> Sorry, I found my mistakes. New fixed one is attached to this mail.

Thanks for revising the patch. Here are the comments:

The document needs to be updated.

The patch caused the following compile warnings in my machine.

pgstat.c:1357: warning: no previous prototype for 'pgstat_report_lwlockstat'
postgres.c:3922: warning: implicit declaration of function
'pgstat_report_lwlockstat'
pgstatfuncs.c:1854: warning: no previous prototype for 'pg_stat_reset_lwlocks'

In my test, this patch caused the measurable performance overhead.
I created the test database by pgbench -s10 and ran pgbench -c8 -j8 -T60 -S.
Results are:

[HEAD]
number of transactions actually processed: 1401369
tps = 23351.375811 (including connections establishing)
tps = 23355.900043 (excluding connections establishing)

[PATCH]
number of transactions actually processed: 1401369
tps = 23351.375811 (including connections establishing)
tps = 23355.900043 (excluding connections establishing)

So I think that tracking lwlock usage should be enabled only when
trace_lwlocks is enabled, so that a user who is not interested in
lwlock usage can avoid such performance overhead.

As far as I read the patch, only lwlock usage by backends is collected.
Why aren't the lwlock usages by autovacuum worker and auxiliary
processes collected?

Regards,

-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: Extend argument of OAT_POST_CREATE
Next
From: Peter Geoghegan
Date:
Subject: Re: enhanced error fields