[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SDD partitioning and allocations



On 7/12/25 20:33, Max Nikulin wrote:
On 11/07/2025 09:41, David Christensen wrote:
AIUI SSD over-provisioning combined with setting the discard flag in fstab(5) provides maximum performance for write intensive workloads.

Is it better than fstrim.timer mentioned in this thread?

Some years ago there was a warning on the
<https://wiki.archlinux.org/title/Solid_state_drive/NVMe>
page that Intel did not recommend continuous TRIM aka discard. Currently there are some words against discard in
<https://wiki.archlinux.org/title/Solid_state_drive#Continuous_TRIM>.

Do you have more details on this story, what was behind Intel suggestion and what has changed since that time?

As to secure erase, I have seen comments claiming that sometimes it helps to recovery performance degraded after some period of usage. I have not tried to collect details if it is related to specific models or to low end drives.


I seem to recall enabling 'discard' at some point in the past and not noticing any difference. But I was not, and still am not, doing write intensive workloads.


I do recall reading articles that warned against 'discard' (10 years ago?). I am not sure if I stopped using 'discard' because of those, because I reinstalled Debian, the Debian installer left out 'discard', and I never enabled it, or both. AFAICT I do not need 'discard', so I leave it disabled.


I was not aware of systemd fstrim.timer. STFW it looks like it is enabled on my daily driver:

2025-07-12 23:56:19 root@laalaa ~
# cat /etc/debian_version ; uname -a
11.11
Linux laalaa 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64 GNU/Linux

2025-07-13 00:01:43 root@laalaa ~
# locate fstrim.timer
/etc/systemd/system/timers.target.wants/fstrim.timer
/usr/lib/systemd/system/fstrim.timer
/var/lib/systemd/deb-systemd-helper-enabled/fstrim.timer.dsh-also
/var/lib/systemd/deb-systemd-helper-enabled/timers.target.wants/fstrim.timer
/var/lib/systemd/timers/stamp-fstrim.timer

2025-07-13 00:01:45 root@laalaa ~
# systemctl status fstrim.timer
* fstrim.timer - Discard unused blocks once a week
Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: > Active: active (waiting) since Sat 2025-07-12 21:55:50 PDT; 2h 5min ago
    Trigger: Mon 2025-07-14 00:04:12 PDT; 24h left
   Triggers: * fstrim.service
       Docs: man:fstrim

Jul 12 21:55:50 laalaa systemd[1]: Started Discard unused blocks once a week.


SSD's are complex devices with many features. I expect the only way to know which of 'discard', fstrim.timer, or running fstrim(8) is "better" is to define your metrics, devise benchmarks for your actual workloads, and collect the data.


David


Reply to: