Skip to content

TBS: Expired entries stay much longer than TTL and consume disk space #15121

Closed
@carsonip

Description

@carsonip

#14923 focuses on resolving the state where apm-server is stuck at exceeding storage limit indefinitely. On the other hand, this Issue focuses on the fact that badger DB disk space is not used efficiently, as entries are staying around for longer than TTL in general. It violates the assumption that badger DB is a factor of event ingest throughput * TTL.

Compactions in badger DB is only triggered by reaching level size target, and may take a long time. If the value size is greater than ValueThreshold, the value is generally cleared on vlog gc, and what's left in LSM tree for longer than TTL is just the key. But if value size is smaller than ValueThreshold, both the key and value live in LSM tree will need to wait for the next compaction.

Potential solution: Lmax to Lmax compaction in badger v4 could be helpful to clear out expired entries without waiting for level size target, but the performance impact is unclear.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions