FreeNAS 9.3 and SSD Trim

Status
Not open for further replies.

shebang1245

Cadet
Joined
Aug 16, 2015
Messages
3
This is a homelab scenario. I am using an ESXi server that uses a FreeNAS server for storage.
I'd like to keep frequently used, client OS VMs on an SSD. I have configured my SSD as an iSCSI extent and using it in ESXi. I can force an UNMAP on the disk through ESXi but I'm not sure if that actually sends TRIM commands to the disk.
'sysctl -a | grep _trim' doesn't report any changes but I figured that is because it only reports ZFS TRIMs. (In this case the disk has VMFS and not ZFS)

In case I have to move to NFS shares, is there something I must do to make sure it works well?
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
Did you put a ZFS filesystem on top of that SSD or did you map it directly as a device extent?

For the former, you should be able to see:

Code:
[root@honeybadger] ~# sysctl -a | grep vfs.zfs.trim.enabled
vfs.zfs.trim.enabled: 1


For the latter, the SCSI UNMAP command is the analog to the ATA TRIM command, so it should be freeing the blocks.
 

shebang1245

Cadet
Joined
Aug 16, 2015
Messages
3
I mapped it directly. I thought it would free the blocks, just needed confirmation that it does.

EDIT: The reason I ask this is because until the previous version, it didn't even let me send UNMAP over iSCSI. I believe UNMAP support was added to make ZFS pools work better, so I wasn't sure if UNMAP does actually ensure a TRIM is performed on the disk.
 
Last edited:

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
I mapped it directly. I thought it would free the blocks, just needed confirmation that it does.

It should be passing the SCSI_UNMAP commands through. Bear in mind that by mapping the device directly you're losing the performance-enhancing benefits of ZFS like ARC.

Switching to NFS will definitely cause you some issues though as you'll now be sharing a ZFS volume over NFS, and ZFS won't be able to "look inside" the VMDK to see which blocks are actually free since FreeNAS doesn't have VAAI support over NAS, just block.
 

shebang1245

Cadet
Joined
Aug 16, 2015
Messages
3
I get the benefit of just plugging the SSD directly to an ESXi host in case I have to. And the client OSes will create their own caches of the disks, right?

I... don't really know what's the best for me.
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
I understand the directly connecting the SSD as a backup, that's a clever failsafe if something goes wrong.

Performance wise if they're just small client/desktop OSes, or your FreeNAS server isn't particularly big, then it's fine to run it that way.

ARC works better when you think of a large FreeNAS server with 64GB+ of RAM being able to cache the most frequently used parts of multiple different VMs and serve them up from RAM rather than having to hit the disk at all.
 
Status
Not open for further replies.
Top