Re: WAL Rate Limiting - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: WAL Rate Limiting
Date
Msg-id 52D7FF27.2090801@vmware.com
Whole thread Raw
In response to Re: WAL Rate Limiting  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: WAL Rate Limiting  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: WAL Rate Limiting  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On 01/16/2014 05:39 PM, Andres Freund wrote:
> On 2014-01-16 10:35:20 -0500, Tom Lane wrote:
>> I think possibly a more productive approach to this would be to treat
>> it as a session-level GUC setting, rather than hard-wiring it to affect
>> certain commands and not others.
>
> Do you see a reasonable way to implement this generically for all
> commands? I don't.

In suitable safe places, check if you've written too much WAL, and sleep 
if so. Call it CHECK_FOR_WAL_BUDGET(), along the lines of 
CHECK_FOR_INTERRUPTS(), but called less frequently. Or maybe 
vacuum_delay_point() is a better analogy. Hopefully you don't need to 
sprinkle them in too many places to be useful.

- Heikki



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Display oprcode and its volatility in \do+
Next
From: Tom Lane
Date:
Subject: Re: WAL Rate Limiting