Skip to content

Improve the logic behind cutting a new chunk and cap the size of a chunk #12009

@codesome

Description

@codesome

Proposal

We have been trying to fill a chunk (the one that uses the Gorilla compression for float value samples, called XORChunk internally) with up to 120 samples with some more logic around to keep the number of samples in a chunk consistent for a series within a block. Compacting multiple blocks together also caps it at 120 samples.

This is insufficient because depending on how well some samples compress, the size of the chunk can grow big, to a few KB.

We should additionally be limiting the size of the chunk. While it may or may not benefit Prometheus directly, the predictability of a chunk size can greatly help downstream users who can later backport any optimizations back to Prometheus.

Without any numbers in hand, I propose to cap at 1024B for a chunk with float samples (there is #11219 for histogram chunks).

The proposal is to cap the chunk size across the board - in the head block, during compaction where you merge chunks, etc.

cc @beorn7 @bboreham @bwplotka @pracucci @dimitarvdimitrov

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