I know this has been discussed many times, but there are a lot of different opinions across the internet which optimizations are good for SSDs (and whether to use them). Also the technology has advanced and some of the advices might have become obsolete.
Overprovisioning and free space on FS
This seems to be still relevant, but according to user cabirum in ycombinator discussion:
you don't have to over-provision unpartitioned space AND preserve 20% of partitioned free space. It's one or another, the point is to have enough free space for proper wear leveling.
on the other hand, there is no mention about it in ArchWiki or in this post by namhuy. What more easylinux advises both!
Noatime, nodirtime and relatime mount options
namhuy advises both, ArchWiki and easylinux advises only noatime and user andmarios in ycombinator says:
noatime: this is old, use relatime.
which is according to man pages default behaviour since Linux 2.6.30.
Trim
This is probably greatest mess
- easylinux Run trim from
/etc/rc.local
. Do not usediscard
mount option. - ArchWiki Use
fstrim.service
andfstrim.timer
. Warns aboutdiscard
. - namhuy and simoncion in ycombinator Use
discard
option.
Limit the write actions
ArchWiki, namhuy, easylinux advises to move browser cache to RAM. This is generally disagreed with in ycombinator.
IO scheduler
It seems that everyone agrees to use Deadline
or NOOP
instead of default CFQ
. But it is not clear to me when to use Deadline
and when NOOP
(Is it file system/SSD vendor dependent?).
Swap
It was not so long ago, that someone told me to disable swap completely (wow :D). According to ArchWiki, namhuy and easylinux set vm.swappiness=1
.
I am a bit confused from all these options. So far I have used only a few of them. Did I failed to mention something important? Does some Linux distro do some of the above automatically?
References:
- ycombinator: https://news.ycombinator.com/item?id=9633161
- easylinux: https://sites.google.com/site/easylinuxtipsproject/ssd#TOC-Optional:-reserve-some-space-for-overprovisioning
- ArchWiki: https://wiki.archlinux.org/index.php/Solid_State_Drives
- namhuy: https://www.namhuy.net/1563/how-to-tweak-and-optimize-ssd-for-ubuntu-linux-mint.html