What is TRIM/discard and how should it be configured?
AdvancedProductionDisk, Capacity & Backups
Answer
TRIM tells SSDs (and thin-provisioned storage) which blocks are no longer in use, preserving performance and reclaiming space on thin volumes. Mounting with discard issues TRIM synchronously on every delete, which can add latency. The common practice is periodic batched TRIM:
sudo systemctl enable --now fstrim.timer # weekly
sudo fstrim -av
For LVM thin pools, also set issue_discards/thin_pool_discards appropriately.
More on Disk, Capacity & Backups
How do you lay out filesystems on a production server?IntermediateHow do you do capacity planning for disk?IntermediateWhat disk usage alert thresholds do you use?BeginnerA disk is 100% full in production. What do you do first?BeginnerHow do you clean up disk space safely on Docker hosts?IntermediateWhat is the 3-2-1 backup rule?Beginner