Why do people 'know' that swap is bad for SSD despite
the fact that for
almost all use cases swap would take
hundreds of years to damage an
SSD?
Some old kernels wasted some CPU time failing to
swap if there was
no swap partition. AFAIK, that is a
thing of the past. Truly ancient computers
were
desperately short of RAM, but disks were relatively
cheap. If you
actually used more swap space than
about twice the RAM, then your computer
would be
annoyingly slow. Modern machines have an abundance
of RAM, and will
work fine without a swap partition.
Like you, my biggest use of swap in
compiling in
tmpfs. I do that so a power cut means restarting the
compile, not
restoring a filesystem if it got
corrupted.
Here is an estimate of how
long your ssd will last.
Change sda to the name of your ssd. Set the write
amplification (1.1 is a boast from Intel. The lowest
boast I have seen is
0.5). Set the erases to 100000
if you have a really expensive SSD or 1000 if
you got conned.
ssd=sda; amplification=1.1; erases=10000; read
<
/sys/block/$ssd/stat -a a; sectors_written=${a[6]};
read
</proc/uptime on idle;
echo
"$erases*$(</sys/block/$ssd/size)*$on/($sectors_written*&
#36;amplification*3600*24*365.24)" |
bc
I get 66 years for the laptop,
12641 years for
the desktop and 8563 years for the π. Wear levelling
and
enormous sizes make it really hard to wear out
an SSD. The practical way to
break one is to pull the
power when they are collecting garbage.
[ Reply to This | Parent | # ]
|