[SOLVED] TRIM/Discard schedule vs discard

baalkor

New Member
Feb 24, 2025
23
0
1
Hello,

We're using an LVM on top of iSCSI presented by a SAN. We've seen that the de-duplication factor sold by the vendor (Dell PowerStore) promised to be 5:1 is definitely not reached.
However, the vendors told us that we might need to enable TRIM for disk configuration and either trigger fstrim or using /etc/fstab discard option to help reducing the de duplication rate to go above our 1.5:1.

- In my understanding, the TRIM was more interesting regarding thin provisioned drive and had little to do with de duplication, am I correct ?
- If I'm wrong, the advertised trim schedule by fstrim man page is once per week is enough, is it correct in our scenario (~200 VMs) ?
- I'm not able to tell which method is better than the other (discard vs fstrim.timer), do you have some guidance ? Since I assume that if all timer triggering all together at the same time ,can render the storage quite slow. What would be the best option ?
- On some big file server, it made FS access very very slow, is discard option better in case ?

Thanks for your time

Appreciate your help.
 
I prefer the timer approach. I wrote a little bit about it here: https://gist.github.com/Impact123/3dbd7e0ddaf47c5539708a9cbcaab9e3#discard
INI:
# systemctl cat fstrim.timer
[Timer]
OnCalendar=weekly
AccuracySec=1h
Persistent=true
RandomizedDelaySec=100min
As you can see here the exact execution time isn't fixed so it probably won't be the case that all guests will be trimming at the same time.
If your data changes a lot a daily timer can be considered. I'm guessing the garbage/scratch space in the LV cannot be deduplicate properly.
Disclaimer: I don't use iSCSI or a SAN.
 
Last edited:
  • Like
Reactions: MME-X and _gabriel
According to proxmox support, if you are using LVM (thick), TRIM command are not passed to the underlying storage and therefore can't be used.
 
There is issue_discards in lvm.conf but I haven't investigated it much.
 
If you're using LVM whether it inside a VM or at host level did'nt change the fact that commands are not sent.
 
@sokritech Yes it works - when we remove an LV it gets cleaned and space is release
but :
- snapshot are sometime impacted because of the time to remove them,
- The issue seems to have been fixed but we don't know which release has the patch https://bugzilla.proxmox.com/show_bug.cgi?id=7339 but I did
- The way proxmox seems to habdle this is not to enable this option but to enable Safe removal and wipe option at DS level. I didn't check recently.