Re: Dynamic LWLock tracing via pg_stat_lwlock (proof of concept) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Dynamic LWLock tracing via pg_stat_lwlock (proof of concept)
Date
Msg-id 20141007143024.GG22022@awork2.anarazel.de
Whole thread Raw
In response to Re: Dynamic LWLock tracing via pg_stat_lwlock (proof of concept)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Dynamic LWLock tracing via pg_stat_lwlock (proof of concept)
List pgsql-hackers
On 2014-10-07 17:22:18 +0300, Heikki Linnakangas wrote:
> FWIW, I liked Ilya's design. Before going to sleep, store the lock ID in
> shared memory. When you wake up, clear it. That should be cheap enough to
> have it always enabled. And it can easily be extended to other "waits", e.g.
> when you're waiting for input from client.

I think there's a few locks where that's interesting. But in my
experience many slowdowns aren't caused by actual waits, but because of
cacheline contention. And for that the number of acquisitions is much
more relevant than the waiting. The primary example for this is probably
the procarray lock.

> I don't think counting the number of lock acquisition is that interesting.
> It doesn't give you any information on how long the waits were, for
> example.

Sure, that's a separate thing that we should be able to answer.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Dynamic LWLock tracing via pg_stat_lwlock (proof of concept)
Next
From: Robert Haas
Date:
Subject: Re: Dynamic LWLock tracing via pg_stat_lwlock (proof of concept)