release-21.1: kvserver: throttle AddSSTable
requests with IngestAsWrites
#74072
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.
Backport 1/1 commits from #73904.
/cc @cockroachdb/release
Store.Send()
limits the number of concurrentAddSSTable
requestsand delays them depending on LSM health via
Engine.PreIngestDelay
, toprevent overwhelming Pebble. However, requests with
IngestAsWrites
were not throttled, which has been seen to cause significant read
amplification.
This patch subjects
IngestAsWrites
requests toEngine.PreIngestDelay
as well, and adds a separate limit for
IngestAsWrites
requestscontrolled via the cluster setting
kv.bulk_io_write.concurrent_addsstable_as_writes_requests
(default10). Since these requests are generally small, and will end up in the
Pebble memtable before being flushed to disk, we can tolerate a larger
limit for these requests than regular
AddSSTable
requests (1).Release note (performance improvement): Bulk ingestion of small write
batches (e.g. index backfill into a large number of ranges) is now
throttled, to avoid buildup of read amplification and associated
performance degradation. Concurrency is controlled by the new cluster
setting
kv.bulk_io_write.concurrent_addsstable_as_writes_requests
.Release justification: prevents pathological performance degradation.