Prometheus v3.5.0 introduces a `use-uncached-io` feature flag (Linux-only) that uses direct I/O for compaction chunk writes, bypassing the page cache. This reduces Prometheus's page cache footprint by 20–50% as measured by `container_memory_cache`, making memory usage more predictable and reducing pressure on shared cache. The implementation required a custom `directIOWriter` to satisfy direct I/O's strict alignment requirements (file offset, buffer address, and transfer size must align to the storage device's logical sector size). Future work includes extending direct I/O to index files and WAL writes, experimenting with the newer `RWF_DONTCACHE` flag in Linux v6.14, and adding support for non-Linux platforms.

4m read timeFrom prometheus.io
Post cover image
Table of contents
Covering more write pathsBuilding more confidence around directIOWriterExperimenting with RWF_DONTCACHESupport beyond Linux

Sort: