This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 169
Throttle vacuum workers based on chunk age #1761
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cevian
suggested changes
Nov 20, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, but would like some cleanup esp wrt using current_setting
jgpruitt
force-pushed
the
john/vacuum
branch
from
November 20, 2022 22:03
3dede5d
to
730c8b9
Compare
jgpruitt
force-pushed
the
john/vacuum
branch
from
November 20, 2022 23:04
730c8b9
to
bbbe179
Compare
niksajakovljevic
approved these changes
Nov 21, 2022
arajkumar
reviewed
Nov 21, 2022
cevian
approved these changes
Nov 21, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'd like some of Arun's comments addressed. Especially the ones relating to metric exposition
jgpruitt
force-pushed
the
john/vacuum
branch
5 times, most recently
from
November 28, 2022 18:40
fe723ce
to
086a8c6
Compare
Throttle vacuum workers based on chunk age. Figure out how many workers to used based on the oldest transaction id age of the chunks in our batch. The age should be between vacuumFreezeMinAge and autovacuumFreezeMaxAge. The closer the maxChunkAge is to the autovacuumFreezeMaxAge, the more workers we assign. If maxChunkAge is == vacuumFreezeMinAge, then we just use 1 worker. If the autovacuum engine beats us to a chunk, skip that chunk.
jgpruitt
force-pushed
the
john/vacuum
branch
from
November 28, 2022 18:43
086a8c6
to
40b227b
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Throttle vacuum workers based on chunk age. Figure out how many workers to used based on the oldest transaction id age of the chunks in our batch. The age should be between
vacuumFreezeMinAge
andautovacuumFreezeMaxAge
. The closer themaxChunkAge
is to theautovacuumFreezeMaxAge
, the more workers we assign. IfmaxChunkAge
is ==vacuumFreezeMinAge
, then we just use 1 worker.In this example,
maxChunkAge
is 57.89% of the way betweenvacuumFreezeMinAge
andautovacuumFreezeMaxAge
. IfmaxParallelism
is 5, then we will use 3 workers.If the autovacuum engine beats us to a chunk, skip that chunk.
Merge requirements
Please take into account the following non-code changes that you may need to make with your PR: