Re: LWLOCK_STATS

From: "Satoshi Nagayasu / Uptime Technologies, LLC(dot)" <snaga(at)uptime(dot)jp>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: LWLOCK_STATS
Date: 2012-01-07 14:02:37
Message-ID: 4F08507D.2000300@uptime.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012/01/07 16:58, Heikki Linnakangas wrote:
> On 07.01.2012 00:24, Robert Haas wrote:
>> It's been a while since I did any testing with LWLOCK_STATS defined,
>> so I thought it might be about time to do that again and see how
>> things look. Here's how they looked back in July:
>>
>> http://archives.postgresql.org/pgsql-hackers/2011-07/msg01373.php
>
> Interesting.
>
> A couple of weeks ago I wrote a little patch that's similar to LWLOCK_STATS, but it prints out % of wallclock time that is spent acquiring, releasing, or waiting for a lock. I find that more useful than the counters.
>
> Here's the patch, I hope it's useful to others. It uses timer_create() and timer_settime(), so it probably won't work on all platforms, and requires linking with -lrt.

I have just written up a systemtap script to observe
lock statistics.

It shows acquire counts, wait counts and
total waiting time for each lwlock every 5 seconds.

Screenshot here:
http://twitpic.com/83p2cz

Is this useful for pg developers?

--
Satoshi Nagayasu <snaga(at)uptime(dot)jp>
Uptime Technologies, LLC. http://www.uptime.jp

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2012-01-07 15:43:43 Re: pgsphere
Previous Message Simon Riggs 2012-01-07 11:09:53 Re: 16-bit page checksums for 9.2