Should we have to adjust the swappiness value in 2018?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
sdet00
Level 1
Level 1
Posts: 1
Joined: Sat Feb 24, 2018 3:00 am

Should we have to adjust the swappiness value in 2018?

Post by sdet00 » Sat Feb 24, 2018 3:13 am

Hey guys, got a quick question here in regards to "swappiness". I have Linux Mint 18.3 64bit on a few PCs. One has 2GB RAM, one has 3GB RAM, and one has 6GB RAM. They all have SSDs, but occasionally I'll refurbish an old PC with Linux Mint which has an older hard drive. I was wondering if it's still optimal to mess with swappiness values. If you're not sure what I'm referring to, it's here: https://sites.google.com/site/easylinuxtipsproject/3

Now, it says that the default swappiness value is 60, and bringing it down to 10 can yield performance improvements. When I tried this around 18 months ago, it definitely seemed like the case. That said, time has passed, and one of the things that I have noticed is that the moment your hit the RAM limit, performance comes to a crawl for around 30 seconds or so, which is not very pleasant. I dual boot Windows and I find that running out of RAM doesn't seem to be as punishing on the system with the way that swap is setup. Now I'm thinking that changing swappiness values perhaps wasn't ideal anymore on modern kernels (I typically run whatever is the latest).

I'm no expert in this field but if someone could let me know their thoughts in the matter I'd be very interested!

User avatar
kc1di
Level 12
Level 12
Posts: 4367
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Should we have to adjust the swappiness value in 2018?

Post by kc1di » Sat Feb 24, 2018 6:00 am

Hello sdet00 and Welcome to Linxu Mint Forums,

This is just my opinion others may disagree -- it all depends on the amount of ram your working with I find anything under 4 Gb adjusting the level will help anything over that threshold it will not make much difference after 4GB you will very seldom run out of ram unless your doing some quite heavy processing of files such as audio or video or heavy gaming. Good Luck.
Easy tips : https://sites.google.com/site/easylinuxtipsproject/
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608

User avatar
catweazel
Level 14
Level 14
Posts: 5449
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Should we have to adjust the swappiness value in 2018?

Post by catweazel » Sat Feb 24, 2018 6:31 am

sdet00 wrote:
Sat Feb 24, 2018 3:13 am
time has passed
And in that time, you're expectations and the uses for your equipment have chnaged and grown. That's where the difference is.
one has 6GB RAM
My phone has more RAM than that. The lagging is telling you that you're expecting too much from your equipment. Either an upgrade or reduced expectations are required.
A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. - Max Planck

User avatar
Pjotr
Level 20
Level 20
Posts: 10214
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Should we have to adjust the swappiness value in 2018?

Post by Pjotr » Sat Feb 24, 2018 6:47 am

sdet00 wrote:
Sat Feb 24, 2018 3:13 am
one of the things that I have noticed is that the moment your hit the RAM limit, performance comes to a crawl for around 30 seconds or so, which is not very pleasant.
If anything, you'd want the swappiness to be set even lower than 10, then.... Try 1. :wink:
Tip: 10 things to do after installing Linux Mint 19 Tara
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

Marziano
Level 6
Level 6
Posts: 1362
Joined: Thu Jan 04, 2018 1:00 pm

Re: Should we have to adjust the swappiness value in 2018?

Post by Marziano » Sat Feb 24, 2018 8:52 am

I just came across a system add-on called Swapspace in the Software Manager. It seems that this would eliminate the need of having to allocate disk space to a swap partition when installing the system:
This system daemon for the Linux kernel aims to do away with the need for large, fixed swap partitions or swap files.

When installing a Linux-based system (invariably GNU/Linux) with Swapspace, the usual swap partition can be omitted, or it can be kept quite small. Whenever Swapspace finds during normal system usage that more virtual memory is needed, it will automatically claim space from the hard disk. Conversely, swap space that is no longer needed is freed up again for regular use by the filesystem.

This means that with Swapspace installed, sizing the system's available swap space during installation is no longer a life-or-death choice. It now becomes practical to run GNU/Linux off just a single, big partition--with no disk space lost to regrettable installation choices. The system should also be able to handle the occasional memory-intensive task that takes much more swap space than was originally foreseen, without leaving the same swap space unused and unusable during normal operation as is normally the case.
source: http://pqxx.org/development/swapspace
Has anyone any experience with this? Would be nice to know how it works.
"Those are my principles, and if you don't like them...well, I have others." -Marx...
Groucho { Marx

User avatar
CaptainKirksChair
Level 4
Level 4
Posts: 258
Joined: Sat Feb 18, 2017 9:29 pm

Re: Should we have to adjust the swappiness value in 2018?

Post by CaptainKirksChair » Sat Feb 24, 2018 6:01 pm

Remember that the swap space is not just used for on-disk RAM. If you have hibernation enabled (usually with laptops) then the swap space is used when the computer hibernates. So if your laptop has 4gb of RAM with hibernation enabled, your swap partition should be 9gb; double the RAM plus a bit extra. The reason is that if RAM is swapped to disk and you hibernate the computer, it needs all that partition space to hibernate safely. And if your laptop battery is running out of juice and you can't get to it in time for a graceful shutdown, Mint will fall into hibernation. Again, you need that partition space.

As for swappiness, I never change mine -- ever. It is set to 60 by default and I leave it there. I have no problems with any of my Mint computers. A laptop with 4gb of RAM, two PC desktops with 8gb, and an iMac 9.1 with 8gb of RAM. They all work flawlessly on Mint Cinnamon 18.2 or 18.3. I have never noticed any performance degradation.

User avatar
catweazel
Level 14
Level 14
Posts: 5449
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Should we have to adjust the swappiness value in 2018?

Post by catweazel » Sat Feb 24, 2018 6:12 pm

CaptainKirksChair wrote:
Sat Feb 24, 2018 6:01 pm
your swap partition should be 9gb; double the RAM plus a bit extra.
1 x RAM + a little extra is sufficient.
A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. - Max Planck

User avatar
kc1di
Level 12
Level 12
Posts: 4367
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Should we have to adjust the swappiness value in 2018?

Post by kc1di » Sat Feb 24, 2018 6:59 pm

Double the ram was the old standard but a space = to ram is now sufficient. in any event a max of 4 gbs is enough for most machines.
Easy tips : https://sites.google.com/site/easylinuxtipsproject/
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608

User avatar
Jim Hauser
Level 5
Level 5
Posts: 506
Joined: Mon Jun 30, 2014 10:08 pm
Location: Pascagoula, Mississippi

Re: Should we have to adjust the swappiness value in 2018?

Post by Jim Hauser » Sun Feb 25, 2018 3:59 am

I have 16 GB memory and swap set for 18 GB for hibernate. I always set swappiness at 10 because it is an old habit. Since upgrading to the 16 GB memory swap has never been used on this system as far as I know.

Post Reply

Return to “Other topics”