Skip to content

[RESILIENCE] Automatic compaction backpressure — slow down writes when compaction can't keep up #229

@ElioNeto

Description

@ElioNeto

Description

When write throughput exceeds compaction throughput, L0 files pile up, causing read amplification to spike. ApexStore needs write backpressure.

Implementation

  1. Track L0 file count per CF
  2. Configurable thresholds:
    • SOFT_LIMIT (L0 > 10): hint to slow down writes
    • HARD_LIMIT (L0 > 20): block writes until compaction catches up
  3. When backpressure activates:
    • New set()/put() calls block with a timeout
    • HTTP API returns 429 Too Many Requests with Retry-After header
    • Metrics show backpressure level
  4. Configuration:
resilience:
  compaction_backpressure:
    soft_limit: 10
    hard_limit: 20
    max_wait_ms: 5000

Labels

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions