Skip to content

improve vm disk performance with VZDiskImageSynchronizationModeFsync #1268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 28, 2022

Conversation

balajiv113
Copy link
Member

Reason
The default disk attachment has a very poor disk performance (mainly when accessed via mmap).

From macOS 12 we have option to set cache and sync mode. Using VZDiskImageSynchronizationModeFsync provides a better performance and best-effort consistency as well.
https://developer.apple.com/documentation/virtualization/vzdiskimagesynchronizationmode/vzdiskimagesynchronizationmodefsync?language=objc

Some results
Commands

#for mmap test
fio --filename=PATH_TO_FILE --direct=1 --rw=randrw --bs=32k --ioengine=mmap --iodepth=256 --runtime=120 --numjobs=4 --time_based --group_reporting --name=iops-test-job --eta-newline=1 --size=1G

#for sync test
fio --filename=PATH_TO_FILE --direct=1 --rw=randrw --bs=32k --ioengine=sync --iodepth=256 --runtime=120 --numjobs=4 --time_based --group_reporting --name=iops-test-job --eta-newline=1 --size=1G

Results
Old
mmap - Read & Write IOPS ~52
sync - Read & write IOPS ~5200

With this PR
mmap - Read & Write IOPS ~3900
sync - Read & write IOPS ~5400

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda added this to the v0.15 (tentative) milestone Dec 28, 2022
@AkihiroSuda AkihiroSuda merged commit 5a2dea0 into lima-vm:master Dec 28, 2022
@balajiv113 balajiv113 deleted the disk-perf branch December 28, 2022 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants