What's your swappiness set to, eh?

For interesting topics. But remember this is a Linux Forum. Do not post offensive topics that are meant to cause trouble with other members or are derogatory towards people of different genders, race, color, minors (this includes nudity and sex), politics or religion. Let's try to keep peace among the community and for visitors.

No spam on this or any other forums please! If you post advertisements on these forums, your account may be deleted.

Do not copy and paste entire or even up to half of someone else's words or articles into posts. Post only a few sentences or a paragraph and make sure to include a link back to original words or article. Otherwise it's copyright infringement.

You can talk about other distros here, but no MX bashing. You can email the developers of MX if you just want to say you dislike or hate MX.
Message
Author
User avatar
entropyfoe
Posts: 590
Joined: Thu Apr 19, 2007 11:42 am

Re: What's your swappiness set to, eh?

#21 Post by entropyfoe »

I have experimented the swapiness settings in Mepis.
As kmathern wrote
"It's not uncommon on my machine to see some swap being used, in fact the free command says it's using a small amount right now."

On systems with lots of RAM (16 and 8G), use of swap does not go away in my playing around until I put it at 1 or 2. Even values as low as 10 would sometimes show small swap usage.

For SSD, even zero is a good value, basically you want to use RAM always before FLASH because RAM does not wear out !
For big RAM amounts I think it can be set to zero, Where zero :

vm.swappiness = 0 The kernel will swap only to avoid an out of memory condition. See the "VM Sysctl documentation".

https://en.wikipedia.org/wiki/Swappiness
says for modern kernels (>3.5 ), a setting of 1 or 0 is best for systems with lots of RAM.
Asus PRIME X470-PRO
AMD Ryzen 3600X (12 threads @ 3.8 GHz)
32 Gig DDR4 3600 (Crucial CL 16)
Nvidia GeForce GT 710
Samsung 970 NVMe nvme0n1 P1-3=MX-23, P4=testing
Samsung 980 NVMe =1TB Data, plus 2TB WD =backups
on-board ethernet & sound

Kestrel
Posts: 23
Joined: Sat Sep 23, 2017 8:52 pm

Re: What's your swappiness set to, eh?

#22 Post by Kestrel »

I have not altered it in MX but I did reduce it when I was using Mint as per this article:
https://sites.google.com/site/easylinux ... swappiness

In fact i reduced it to 1 which is very low. But as I had 8gb of ram I figured it should be fine as I had never used the swap partition ever. I noticed when I first installed MX16 that it was using the swap partition occasionally so I have not yet reduced swappiness. However as I barely use 2gb of my 8gb ram I could probably reduce it. But its not a priority because I am using an HDD which is not going to be effected by read/write as much as an SSD would....actually modern ssd's can withstand a lot more so this doesnt seem such a big issue nowadays.
Dell Inspiron 530 Desktop
8gb DDR2 RAM @ 800mhz
Intel® Core™2 Duo Processor E8600 3.33 GHz
MX-21.3

User avatar
Mauser
Posts: 1350
Joined: Mon Jun 27, 2016 7:32 pm

Re: What's your swappiness set to, eh?

#23 Post by Mauser »

I format the hard drive so the swap patrician is st least the same as the amount of RAM I have. As for people saying they set it to values, I don't know what you are talking about.
I am command line illiterate. :confused: I copy & paste to the terminal. Liars, Wiseguys, Trolls, and those without manners will be added to my ignore list. :mad:

User avatar
asqwerth
Developer
Posts: 7210
Joined: Sun May 27, 2007 5:37 am

Re: What's your swappiness set to, eh?

#24 Post by asqwerth »

Swappiness is not the size of the swap partition, but the percentage threshold of remaining RAM memory at which your system will start saving/writing the data in use to the swap partition, just in case you run out of RAM.

So if you have 4GB swap and your swappiness is 10, it means that when you have 10%=400MB RAM left unused, it will start writing to swap.

The default value is 60, meaning that when you hit 60% of RAM left unused, the swap writing starts. When you have tons of RAM to spare, that's really premature. There's no need to add unnecessary wear and tear to your hard drive/SSD.

I set mine to 1. 1% of 16GB RAM is 160MB but I've never even used 50% of my RAM, so it is very unlikely swap writing will ever be activated on my system.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
Mauser
Posts: 1350
Joined: Mon Jun 27, 2016 7:32 pm

Re: What's your swappiness set to, eh?

#25 Post by Mauser »

[quote="asqwerth"][/quote] Thank you for explaining. How do I set that?
I am command line illiterate. :confused: I copy & paste to the terminal. Liars, Wiseguys, Trolls, and those without manners will be added to my ignore list. :mad:

User avatar
asqwerth
Developer
Posts: 7210
Joined: Sun May 27, 2007 5:37 am

Re: What's your swappiness set to, eh?

#26 Post by asqwerth »

Check the link in the first post of this thread.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
Mauser
Posts: 1350
Joined: Mon Jun 27, 2016 7:32 pm

Re: What's your swappiness set to, eh?

#27 Post by Mauser »

asqwerth wrote:Check the link in the first post of this thread.
Thanks. It looks like it's not adjustable because I have no such folder called sysctl.conf. The closest I have is sysctl.d and there is nothing in there like that. Thanks anyway.
I am command line illiterate. :confused: I copy & paste to the terminal. Liars, Wiseguys, Trolls, and those without manners will be added to my ignore list. :mad:

User avatar
stsoh
Posts: 183
Joined: Sun Aug 20, 2017 10:11 am

Re: What's your swappiness set to, eh?

#28 Post by stsoh »

sysctl.conf is a file in /etc folder.
it is better tat u put this 'echo 10 > /proc/sys/vm/swappiness' in /etc/rc.local file b4 the word 'exit'.
MX-17.1_x64 Horizon, G41M-P33 Combo (MS-7592), Pentium E5400 (2706 MHz), 8Gb RAM (984 MT/s),
Intel 4 Series Integrated Graphics, Realtek PCIe Fast RTL8101/2/6E, PCI Gigabit RTL8169 Ethernets.
Accepted Linux when i found MX-Linux in 2016.

User avatar
Mauser
Posts: 1350
Joined: Mon Jun 27, 2016 7:32 pm

Re: What's your swappiness set to, eh?

#29 Post by Mauser »

stsoh wrote:sysctl.conf is a file in /etc folder.
it is better tat u put this 'echo 10 > /proc/sys/vm/swappiness' in /etc/rc.local file b4 the word 'exit'.
Not in mine. I looked there and it's no where in that folder. The closest thing I found to it is sysctl.d
I am command line illiterate. :confused: I copy & paste to the terminal. Liars, Wiseguys, Trolls, and those without manners will be added to my ignore list. :mad:

User avatar
Jerry3904
Administrator
Posts: 21881
Joined: Wed Jul 19, 2006 6:13 am

Re: What's your swappiness set to, eh?

#30 Post by Jerry3904 »

Here's a handy command that will help:

Code: Select all

$ locate sysctl.conf
/etc/sysctl.conf
/etc/sysctl.d/99-sysctl.conf
/etc/ufw/sysctl.conf
/usr/share/doc/procps/examples/sysctl.conf
/usr/share/man/man5/sysctl.conf.5.gz
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

Post Reply

Return to “General”