Re: Performance monitor signal handler

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Jan Wieck <JanWieck(at)yahoo(dot)com>, PostgreSQL HACKERS <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Performance monitor signal handler
Date: 2001-03-19 16:28:24
Message-ID: 19724.985019304@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Only shared memory gives us near-zero cost for write/read. 99% of
> backends will not be using stats, so it has to be cheap.

Not with a circular buffer it's not cheap, because you need interlocking
on writes. Your claim that you can get away without that is simply
false. You won't just get lost messages, you'll get corrupted messages.

> The collector program can read the shared memory stats and keep hashed
> values of accumulated stats. It uses the "Loops" variable to know if it
> has read the current information in the buffer.

And how does it sleep until the counter has been advanced? Seems to me
it has to busy-wait (bad) or sleep (worse; if the minimum sleep delay
is 10 ms then it's guaranteed to miss a lot of data under load).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-03-19 16:33:45 Re: /contrib 'cosmetic'
Previous Message Bruce Momjian 2001-03-19 16:14:22 Re: new version of contrib-intarray