Mailinglist Archive: opensuse (794 mails)

< Previous Next >
Re: [opensuse] Get an SSD just for swap?
On 27/11/17 04:08, John Andersen wrote:
I've never been more pleased with the performance of this old machine.

Soon as I get it to 4.14 I'll be happier yet, because swap is gaining a
multiple pointer system
into swap space, one for each core. See
That means swap is not going to be a bottle neck any more.

The case for encouraging swap use is getting STRONGER, not weaker.

If you've got multiple drives, provision swap on EVERY drive, then in
fstab set "pri=x" to the same x for all of them. That will then create a
*striped* array for swap, improving performance.

If you don't specify priority, linux creates a linear array, that uses
one drive until it fills up then goes on to the next.

Striped gives you speed, but if a disk breaks it will take out every
process that's been swapped. Linear will only take out processes swapped
to that disk.

That said, on my new system I'm going to set swap up as raid-10 with
mdadm, which gives the benefits of both at the expense of a bit of disk

Don't be stingy when provisioning swap space on an SSD. SSD's need to be
over provisioned
to protect device life cycle. Got 8 gig of ram? 16 gig of swap is not too

As far as I'm concerned the old rule of "no swap or at least twice ram"
still applies. Everybody said the "twice swap" rule was an old wive's
tale, even before linux was born, then kernel 2.4.0 hit and people found
out the hard way it wasn't. I don't know whether the fundamental
algorithm has changed since then (that was the trigger for a major
rewrite of the swap subsystem), but hey disk is cheap so I take the
*maximum* ram my mobo supports, double it, and provision that *per
disk*. So I currently have 64GB swap (16GB ram times two times two
disks). That's going up to 256GB on my new system (64GB max ram times
two times three disks times raid-10) when I get it up and running.

(Admittedly, that system is gentoo, so I mount /var/tmp/portage as tmpfs
and that needs about 20GB for things like LO, GCC etc.)

NB - If you've got a small SSD, set "pri=1" for the SSD, and "pri=2" (or
is it the other way round? Look it up) for the HDs, and linux will
preferentially use the SSD, only using rust when the SSD is full.


To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups