venice icon indicating copy to clipboard operation
venice copied to clipboard

[server] Feature to tune level0 compaction tuning for read-write leader

Open gaojieliu opened this issue 9 months ago • 0 comments

In the ingestion path, we often tune level0 compaction to optimize read/write/space optimization. When AA/WC is enabled, the leader replica will read the same database while ingesting, which is different from standby replicas. To optimize the read perf of leader replica, this PR exposes the following config: rocksdb.level0.compaction.tuning.for.read.write.leader.enabled: default false rocksdb.level0.file.num.compaction.trigger.for.read.write.leader: default 10 rocksdb.level0.slowdown.writes.trigger.for.read.write.leader: default 20 rocksdb.level0.stops.writes.trigger.for.read.write.leader: default 40

Essentially, there are 3 sets of level0 compaction tunings:

  1. Leader replicas for AA/WC stores.
  2. Future version.
  3. Current version.

The main reason we would like to only optimize the leader replica for AA/WC stores:

  1. Standby replicas don't read at ingestion path.
  2. Try to keep the write/space amplication factor for standby replicas as more aggressive level0 compaction tuning is expensive.

How was this PR tested?

CI

Does this PR introduce any user-facing changes?

  • [x] No. You can skip the rest of this section.
  • [ ] Yes. Make sure to explain your proposed changes and call out the behavior change.

gaojieliu avatar May 15 '24 16:05 gaojieliu