Passed throu Samsung 960 M.2 drive - bad performance


kimmer

Recommended Posts

As topic says.

I'm new to Unraid, and this is my first build. I have the following hardware

Ryzen 7 1800x - standard clock

Asrock X370 Taichi - latest firmware

16 gig RAM

Samsung 960 500 gig M.2 drive

 

First I did setup the server with only the 960 drive as a cache drive, assiged the VM 250gig, but the performance was horrible, like 15-20 Mbyte/s read/write.

Then I tried over, and dropped the M.2 drive into unassigned devices, and installed the VM on the drive and gave it 250 gig again.. Speed is better, now I am getting 200'ish Mbyte/sec read/write - but i dident get this drive if I couldent utelize the complete power of the drive.

 

Both times I have used the redhat driver.

The OS is win 10 pro.

Link to comment

In Windows 10, both times there was a driver issue - I used the VirtIO driver from the latest package.. When installing the drivers, I belive/remember that they were signed by Redhat - that was what I was meaning.

 

I have been looking into Spaceinvaders Ones vids . and they are awesome.... I dont have the time to figure out to make a proper passthrou at this time tho. But I belive that his method will work.

 

Link to comment

Why use a driver at all? Modify the VM to just pass the entire drive as a block device to the VM, and let the VM manage the driver like normal...

 

Just replace the <source file/> line with the device name and make sure it is labeled raw...  Just make sure not to use the normal device name (something like /dev/nvme1), but rather make sure to use something like

/dev/disks/by-id/nvme-Samsung_SSD_960_EVO_50...

that way it will not change randomly when you add/remove disks from your system...  That will give you the best possible performance since it will be native at that point...  Downside is the entire disk belongs to the VM at that point...

 

I have a similar setup however, and I have mine setup as the cache drive, then setup the disk like such:

<disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writethrough' discard='unmap'/>
      <source file='/mnt/user/kvm_machines/CompName/MainDrvWin10.SCSI.raw.img'/>
      <target dev='sda' bus='scsi'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>

Couple of things to notice here, I used the virtio-scsi driver... Since this is not an option in the unRaid Gui, I had to change it to SCSI using Virt-Manager docker...  I am using a raw image file, and had to make sure to install the windows virtio-scsi driver during install...  Main reason for using the SCSI driver instead of the normal virtio-stor driver is that this allows me to add the 

discard='unmap'

to the disk definition, which makes the disk self shrinking, passing the trim commands on to the physical storage, and allows the guest VM to thin-provision the disk...

 

This allows near native performance while still allowing the rest of the disk to be used by unRaid...  But you have to make sure to setup your shares to not fill the cache, or else all kinds of issues crop up from out of disk space issues...

 

If you install it native, you most likely will need to enable the MSI interrupts in the guest, in order to make sure they get passed to the host, which I mentioned above...

 

Edited by Warrentheo
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.