VM with physical disk attached. Much slower than physical machine...

bartplessers

New Member
Feb 15, 2023
10
0
1
Hi,

For a migration, I have created a VM as described in https://pve.proxmox.com/wiki/Windows_10_guest_best_practices
Than I have attached a physical SSD-disk and configured passtrough, according to https://pve.proxmox.com/wiki/Passthrough_Physical_Disk_to_Virtual_Machine_(VM)
Code:
qm set 114 -scsi2 /dev/disk/by-id/ata-LITEON_LCH-256V2S-11_2.5_7mm_256GB_TW066GD55508561SH02B

On the other hand, I have my old physical machine with (another) phycical SSD attached

Both machines have same number of 4 CPU and 8GB RAM.
The physical machine has an i5-3570 CPU@3.40GHZ
The virtual machine has is hosted on a 4 x Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz

I compared both machines when doing an index of my music library: I started a tool "MP3Tag" and connected to my music library (a copy of my library exists on both SSD's)

Now I noticed that my physical machine is much faster (5 a 6 times faster) than my virtual machine in doing that job.
Of course the comparison is not ideal: machines and SSD's are different, but still, the difference is huge...

I want to get rid of my physical machine, but I can not detach the internal disk for a fairer comparison.

So my question(s):
- is this behaviour normal? Do you really loose so many resources with passtrough disks?
- how can I optimize my settings?

Kind regards,

Bart Plessers
 
You can't compare different SSD models. A good one can be 1000x faster than a bad one. And qm set 114 -scsi2 /dev/disk/by-id/ata-LITEON_LCH-256V2S-11_2.5_7mm_256GB_TW066GD55508561SH02B is no real passthrough where your GuestOS can directly access the physical disk. That disk is still virtualized so you get virtualization overhead. But this overhead shouldn`t be as bad as factor 5-6.
 
You can't compare different SSD models. A good one can be 1000x faster than a bad one. And qm set 114 -scsi2 /dev/disk/by-id/ata-LITEON_LCH-256V2S-11_2.5_7mm_256GB_TW066GD55508561SH02B is no real passthrough where your GuestOS can directly access the physical disk. That disk is still virtualized so you get virtualization overhead. But this overhead shouldn`t be as bad as factor 5-6.
Hi @Dunuin

Thanx for prompt reply.

Is there another way to directly access the physical disk? How?

If not, what is a ‘normal’ overhead?

And are you aware of a more scientific way to test the disk performance? My OS is Windows10. Maybe I can shutdown my old physical server and attach it’s disk to my PVE to do a better comparison.

Kind regards,
Bart
 
Hi @Dunuin,

I just did following test

Code:
winsat disk -drive D

Results:

VIrtual Machine
Code:
> Disk  Random 16.0 Read                       221.67 MB/s          7.9
> Disk  Sequential 64.0 Read                   509.51 MB/s          8.1
> Disk  Sequential 64.0 Write                  277.99 MB/s          7.6
> Average Read Time with Sequential Writes     0.553 ms          7.9
> Latency: 95th Percentile                     2.847 ms          7.1
> Latency: Maximum                             3.707 ms          8.6
> Average Read Time with Random Writes         0.574 ms          8.6

Psyical Machine
Code:
> Disk  Random 16.0 Read                       1.39 MB/s          3.8
> Disk  Sequential 64.0 Read                   142.09 MB/s          7.1
> Disk  Sequential 64.0 Write                  100.74 MB/s          6.6
> Average Read Time with Sequential Writes     2.379 ms          6.8
> Latency: 95th Percentile                     11.978 ms          5.4
> Latency: Maximum                             44.676 ms          7.9
> Average Read Time with Random Writes         5.862 ms          5.7


So it seems that at least this test suggests that my VM is much faster!
But reading 30.000 mp3-files in MP3tag takes 6 times more time in the VM compared to the physical PC

Does anybody know what can cause this behaviour?

bart
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!