---
title: "Grafana Mimir Compaction: From Bottleneck to Savings"
description: "After migrating from Thanos to Grafana Mimir at about 6 million samples per second, Wise found its compactor quietly falling behind on its largest tenant."
url: "https://swe.quest/articles/grafana-mimir-compaction-from-bottleneck-to-savings-ae4536035e4ec4c3"
canonical: "https://medium.com/wise-engineering/grafana-mimir-compaction-from-bottleneck-to-savings-b26c6b0125a6"
source: "Wise Engineering"
published: "2025-01-15"
difficulty: "medium"
kind: "Case study"
reading_minutes: 9
tags: ["observability","storage-systems","cost-optimization","performance","multi-tenancy"]
---

# Grafana Mimir Compaction: From Bottleneck to Savings

A post on [Wise Engineering](https://swe.quest/sources/wise.md), published 2025-01-15, 9 min read, Case study. Original: [https://medium.com/wise-engineering/grafana-mimir-compaction-from-bottleneck-to-savings-b26c6b0125a6](https://medium.com/wise-engineering/grafana-mimir-compaction-from-bottleneck-to-savings-b26c6b0125a6)

## Summary

After migrating from Thanos to Grafana Mimir at about 6 million samples per second, Wise found its compactor quietly falling behind on its largest tenant. The result was a two-month backlog of roughly 250k uncompacted blocks, with block metadata sync taking around 9 hours, and it showed up as higher query errors and latency, bloated S3 storage and extra cross-AZ traffic. Giving the compactor more CPU and memory and tuning its config parameters in staging cleared the backlog. That cut S3 usage by 70%, cross-AZ transfer by 40% and query latency by about 90%. The main lesson is to alert on per-tenant block growth and compaction health, because the default mixin dashboards and alerts did not flag the problem.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)

## Prerequisites

- Prometheus metrics storage ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- object storage basics ([easy posts on Storage systems](https://swe.quest/tags/storage-systems.md?difficulty=easy))
- TSDB blocks and compaction

## Keywords

Grafana Mimir, Thanos, Amazon S3, store-gateway, Mimir compactor

## Related posts

- [Husky: Efficient compaction at Datadog scale](https://swe.quest/articles/husky-efficient-compaction-at-datadog-scale-eba7e7c7e1831aee.md): Datadog Engineering · 2025-01-29 · Hard · 18 min read · Storage engines, Analytics & OLAP, Observability, Performance engineering, Distributed databases
  Husky, Datadog's observability event store layered over object storage, keeps query cost low by controlling fragment count and layout through streaming compaction.
- [Observability At Scale — Every Byte Counts](https://swe.quest/articles/observability-at-scale-every-byte-counts-3491ffe2c3088798.md): Wise Engineering · 2026-10-20 · Medium · 14 min read · Observability, Cost optimization, Performance engineering, Kubernetes
  Five observability changes at Wise cut monthly spend by 40%.
- [Xet is on the Hub](https://swe.quest/articles/xet-is-on-the-hub-31527082840b41cc.md): Hugging Face · 2025-03-18 · Medium · 9 min read · Storage systems, Performance engineering, Load balancing, Scaling
  Hugging Face migrated its first model and dataset repositories from Git LFS to Xet storage, which uses content-defined chunking (~64 KB chunks aggregated into ~64 MB blocks) so that only changed bytes are uploaded.
- [How SolarWinds uses ClickHouse BYOC for real-time observability at scale](https://swe.quest/articles/how-solarwinds-uses-clickhouse-byoc-for-real-time-observability-at-scale-39448c307e0eeb75.md): ClickHouse · 2025-03-11 · Medium · 5 min read · Analytics & OLAP, Performance engineering, Observability, Cloud platforms
  SolarWinds ingests about 3 million telemetry messages per second, roughly 550 MB/s with 1 GB bursts, into ClickHouse ReplacingMergeTree tables.
- [Making multiplayer more reliable](https://swe.quest/articles/making-multiplayer-more-reliable-3fb296ccf52c818b.md): Figma · 2022-10-20 · Medium · 10 min read · Real-time systems, Storage systems, Resilience, Rust, Cloud platforms
  Figma added a write-ahead journal to its in-memory multiplayer service, which previously persisted files only via full checkpoints to S3 every 30–60 seconds.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
