How Prometheus Halved Its Memory Usage - Bryan Boreham, Grafana Labs
Channel: CNCF [Cloud Native Computing Foundation]
Date: 2023-11-08

How Prometheus Halved Its Memory Usage - Bryan Boreham, Grafana Labs

Prometheus is the most popular CNCF project for monitoring, but if you have millions of metrics it needs gigabytes of memory.
And, Prometheus runs as a single process: it’s sometimes a challenge to find a machine large enough to run it.
The good news is that, over the past year, work has been done to reduce Prometheus’ memory usage, in some cases by 50%.

In this talk we’ll look at:
* What kinds of data Prometheus is holding in memory.
* How profiling lets you analyze where the biggest savings could be found.
* How transaction isolation was causing a big blow-up for the largest Prometheus.
* Why a whole new data structure was needed for the labels that identify time series.
* The impacts of these changes on related projects such as Cortex and Thanos.