Skip to content

Commit 6fad03d

Browse files
committed
perf: disable flush on snapshot saving
Firecracker is taking significant time on saving the snapshot file. For comparison: writing the memory snapshot by us (1GiB) takes 1s, and writing the snapshot file by Firecracker (150KiB) takes 8.5s. We presume this is because of the syncing of the metadata, which is why we disable it for now. The filesystem should still handle persisting, and given the fact that the snapshot/memory files are temporary anyway, we can afford to not sync/flush.
1 parent 84c87c3 commit 6fad03d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/vmm/src/persist.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,14 @@ fn snapshot_state_to_file(
319319
snapshot
320320
.save(&mut snapshot_file, microvm_state)
321321
.map_err(SerializeMicrovmState)?;
322-
snapshot_file
323-
.flush()
324-
.map_err(|err| SnapshotBackingFile("flush", err))?;
325-
snapshot_file
326-
.sync_all()
327-
.map_err(|err| SnapshotBackingFile("sync_all", err))
322+
// Disable the following lines as we're seeing some performance issues with btrfs on these operations
323+
// snapshot_file
324+
// .flush()
325+
// .map_err(|err| SnapshotBackingFile("flush", err))?;
326+
// snapshot_file
327+
// .sync_all()
328+
// .map_err(|err| SnapshotBackingFile("sync_all", err))
329+
Ok(())
328330
}
329331

330332
fn snapshot_memory_to_file(

0 commit comments

Comments
 (0)