Company
Date Published
Author
Joshua Hesketh
Word count
1379
Language
English
Hacker News points
None

Summary

Grafana Mimir, an open-source time series database for Prometheus, has achieved up to a 10x improvement in query performance through the implementation of two sharding techniques: time splitting and query sharding. These techniques allow Mimir to execute a single query across multiple CPU cores and machines in parallel, addressing the limitations of the Prometheus PromQL engine, which runs on a single thread. Time splitting divides a query by time intervals to distribute the load across multiple queriers, while query sharding distributes a query across multiple queriers based on the series subset, facilitating parallel execution. This method significantly reduces execution time for high cardinality and CPU-intensive queries, as evidenced by a reduction in execution time from 38 seconds to 4 seconds in one instance. Approximately 60% of customer queries on Grafana Cloud are sharded, demonstrating notable performance benefits. Grafana Labs continues to enhance query performance and expand sharding support for more query types, with further resources available through their documentation and webinars.