Skip to content

I/O performance in a virtual machine #204

@jingshanccc

Description

@jingshanccc

Describe the bug
I am testing the disk I/O performance in a virtual machine and found that both read and write performance have significantly degraded (by several times) compared to the host machine. I would like to know if this is expected and if there are any optimization methods available. Thx~
我正在测试虚拟机中的磁盘IO性能,发现相对于母机来说,读写性能都变差了许多(数倍),我想问是否符合预期,同时是否有优化的方式。非常感谢

To Reproduce

  1. Use vz.NewVirtualMachine to create a virtual machine with specified configurations, and use vz.NewMacOSInstaller to install the virtual machine from an official IPSW file.
  2. For the disk, use vz.NewVirtioBlockDeviceConfiguration and create an IMG file as the disk via vz.CreateDiskImage.
  3. 使用vz.NewVirtualMachine创建指定配置的虚拟机,通过vz.NewMacOSInstaller,从官方的ipsw文件安装得到虚拟机
  4. 磁盘使用的是vz.NewVirtioBlockDeviceConfiguration,通过vz.CreateDiskImage创建img文件作为磁盘

Screenshots
Disk I/O performance of the local machine (MacBookPro M4) / 本机(MacBookPro M4)的磁盘IO数据

Image

Virtual machine disk I/O performance / 虚拟机的磁盘IO数据

Image

Environment that you use to compile (please complete the following information):

  • Xcode version: Xcode 16.4
  • macOS Version: macOS15.6
  • mac architecture: arm
  • Go Version: 1.24.4

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions