I carried it over from my practices on desktop Linux, where one can choose to use the (1)
discard
mount option or (2) the weekly timer (implemented with SystemD's
fstrim.timer
) to issue trim(s) to all applicable filesystems once per week.
The former has negative performance implications, as each delete operation is followed with a discard. Theoretically this can cause additional wear on the SSD as it requires a higher voltage to reset the memory cells, and might possibly trigger it to do its garbage collection more often.
Whereas a weekly trim is only
once per week (rather than
multiple times an hour or day, depending on how often you delete files), and thus there is less noticeable performance impact for multiple delete operations and theoretically less wear on the SSD.
Most importantly, I've been happily using weekly trims, not only on my desktop Linux computers, but also on TrueNAS,
without noticing any performance losses, whether with file deletions or new writes. On top of this, I have the peace of mind knowing that the SSD will do its internal garbage collection
less often. (Hopefully?)
The above might not entirely be true, since garbage collection happens at the firmware level; so it's not like each time a trim/discard is issued that the SSD will immediately run its garbage collection to consolidate "unused" areas so that they can be reset with those "zippity zaps".
EDIT: To add more nuance, I believe there is a
"discard=async"
mount parameter for BTRFS under Linux (and possibly the other filesystems?), which can help with the previous performance penalty. ZFS may in fact use this method as well, so that if the "Auto TRIM" pool option is enabled, you won't notice the performance impacts.