Files
buildkit/worker
ZRHann 12b0763885 metadata: set NoFreelistSync on bolt databases to avoid write amplification
bbolt rewrites the entire freelist on every transaction commit. Once a
metadata database accumulates many free pages (for example after GC frees
most of a large database), each small metadata write amplifies into a
multi-MB disk write. With a high commit rate this can saturate disk write
bandwidth and, because every commit holds bbolt's single writer lock while
fsyncing, stall otherwise-cheap build operations.

Set NoFreelistSync on the bolt databases that buildkit opens itself
(containerdmeta.db, metadata_v2.db and cache.db). The freelist is not data;
it is reconstructed by scanning the database on open, so durability is
unaffected. containerd applies the same option to its own metadata database
for the same reason: https://github.com/containerd/containerd/pull/6761

Signed-off-by: ZRHann <zrhann@foxmail.com>
2026-09-29 18:37:28 +02:00
..
2025-01-13 16:42:48 -08:00