Re: AutoVacuum starvation from sinval messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: AutoVacuum starvation from sinval messages
Date
Msg-id 10593.1352472636@sss.pgh.pa.us
Whole thread Raw
In response to Re: AutoVacuum starvation from sinval messages  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: AutoVacuum starvation from sinval messages  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> So, do we need a sinval overrun or just a sinval message to provoke
> starvation?  The former would be bad but the latter would be really,
> really bad.

The former.  Actually, a signal will be sent as soon as a backend is
determined to be unreasonably far behind, which I think is when the
message queue is half full.  In the AV launcher case, the queue probably
never actually overflows; but the launcher has to wake up to process
messages every so often, and that wakeup cycle is breaking the timeout
management in WaitLatch.

> IIRC the queue has 4K entries, and IIRC a single DDL
> operation might provoke a couple of sinvals, but I'm thinking that
> somebody would probably have to be creating >1024 temp tables a minute
> to overrun the queue, which is very possible but not necessarily
> common.

Well, one DDL typically generates multiple messages --- one for each
catalog row added/modified/removed, roughly speaking.  When I run the
constant create/drop example Jeff posted, I see the AV launcher getting
a catchup signal every few seconds.  I didn't try to determine exactly
how many create/drop cycles that was, but I'm pretty sure it's a lot
less than 1000.
        regards, tom lane



pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: TRUNCATE SERIALIZABLE and frozen COPY
Next
From: Marti Raudsepp
Date:
Subject: Re: TRUNCATE SERIALIZABLE and frozen COPY