mirror of
https://github.com/moby/buildkit.git
synced 2026-11-06 13:26:48 +00:00
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>