containerd 2.2's mount manager panics on a one-mount mkfs chain
containerd 2.2 shipped a mount manager: a service that can format a file as ext4 or xfs, attach it as a loopback device, and hand the result to a runtime, all from a single Activate call instead of the usual truncate , mkfs , losetup , mount sequence. I wanted to know whether that call is actually faster than doing it by hand, so I wrote a small Go program against the manager's package directly…
containerd 2.2 introduced a mount manager service capable of formatting a file as ext4 or xfs, attaching it as a loopback device, and handing the result to a runtime - all within a single Activate call. To determine if this single call was faster than the traditional sequence of truncate, mkfs, losetup, and mount commands, a Go program was created and executed multiple times on the same machine.
The results showed that the manual sequence was faster, taking 24.4 to 25.9 milliseconds compared to the mount manager's Activate call, which took 29.6 to 47.2 milliseconds. The manager panicked once, leaked a raw BoltDB error, and left an unmanageable loop device behind. The mount manager is designed for composability across snapshotters and runtimes, not for raw speed.
When a new API bundles multiple steps into one, it's crucial to benchmark it against the shortest correct version of those steps, rather than the more familiar but longer version.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.