Mailinglist Archive: opensuse (794 mails)

< Previous Next >
Re: [opensuse] Get an SSD just for swap?
  • From: "Carlos E. R." <robin.listas@xxxxxxxxxxxxxx>
  • Date: Wed, 29 Nov 2017 15:12:53 +0100 (CET)
  • Message-id: <alpine.LSU.2.21.1711291503150.31979@Telcontar.valinor>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On Tuesday, 2017-11-28 at 16:37 -0000, Wols Lists wrote:

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 https://lwn.net/Articles/704478/
That means swap is not going to be a bottle neck any more.

The case for encouraging swap use is getting STRONGER, not weaker.
https://lwn.net/Articles/690079/

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.

This is what I had on my computer, but the performance in Leap was bad. It was good enough in 13.1. That's why I had to buy an SSD.


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
space.

You really do not need that unless you run your machine 24*7.


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 much.

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.

The rule of "twice the ram" was a Windows 3 rule. And it was a rule because a) we used as much swap as we could, because RAM was scarce and expensive, and b) the max swap the system allowed was twice the RAM.

There is no such rule in Linux; simply use as much as you need.

In Linux I have run machines with about 30 times SWAP/RAM ratio. It worked fine - albeit slowly, of course. Yes, that amount of swap was needed, there was a memory hole in YaST that ate ram when updating.

In this desktop machine the ratio is 3.


(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.

Yes, good idea.

- -- Cheers,
Carlos E. R.
(from openSUSE 42.2 x86_64 "Malachite" at Telcontar)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAloewGUACgkQtTMYHG2NR9XCmQCdEIICWvUGzQ+nbjUUT+ES7bTi
p+YAn2mN2SEP5XxPPA72cx2RdQ0O/LJa
=A4il
-----END PGP SIGNATURE-----

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

< Previous Next >
Follow Ups