Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

What's your swappiness set to, eh?

Feel free to talk about anything and everything in this board. Just don't 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
Forum Regular
Forum Regular
Posts: 776
Joined: Thu Apr 19, 2007 11:42 am

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

#21 Post by entropyfoe » Sat Jun 20, 2015 9:14 pm

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 370X-Pro
AMD Ryzen 1600X (6 cores @ 3.6 GHz)
16 Gig DDR4 3200 (G Skill)
Nvidia -MSI GeForce GT 710 fanless
Samsung 960 NVMe SSD nvme0n1 P1,P2, and P3=MX-17, P4=antiX-17
1TB SSD sda1= Data, 2TB WD =backups
on-board ethernet & sound

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

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

#22 Post by Kestrel » Mon Feb 05, 2018 12:40 pm

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
160gb HDD
8gb DDR2 RAM @ 800mhz
Intel® Core™2 Duo Processor E8600 (6M Cache, 3.33 GHz, 1333 MHz FSB)
Integrated Intel Graphics (no GPU installed)
MX-16.1 64-bit (4.9.0 kernel)

User avatar
Mauser
Forum Regular
Forum Regular
Posts: 492
Joined: Mon Jun 27, 2016 7:32 pm

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

#23 Post by Mauser » Mon Feb 05, 2018 11:13 pm

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.

User avatar
asqwerth
Forum Guide
Forum Guide
Posts: 2915
Joined: Sun May 27, 2007 5:37 am

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

#24 Post by asqwerth » Mon Feb 05, 2018 11:42 pm

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
Forum Regular
Forum Regular
Posts: 492
Joined: Mon Jun 27, 2016 7:32 pm

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

#25 Post by Mauser » Tue Feb 06, 2018 12:03 am

[quote="asqwerth"][/quote] Thank you for explaining. How do I set that?

User avatar
asqwerth
Forum Guide
Forum Guide
Posts: 2915
Joined: Sun May 27, 2007 5:37 am

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

#26 Post by asqwerth » Tue Feb 06, 2018 12:20 am

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
Forum Regular
Forum Regular
Posts: 492
Joined: Mon Jun 27, 2016 7:32 pm

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

#27 Post by Mauser » Tue Feb 06, 2018 12:45 am

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.

User avatar
stsoh
Forum Regular
Forum Regular
Posts: 334
Joined: Sun Aug 20, 2017 10:11 am

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

#28 Post by stsoh » Tue Feb 06, 2018 2:56 am

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 (min/max: 1203/2700 MHz), 8Gb RAM (800 MT/s),
Intel 4 Series Integrated Graphics, Realtek PCIe Fast RTL8101/2/6E, PCI Gigabit RTL8169 Ethernets.

User avatar
Mauser
Forum Regular
Forum Regular
Posts: 492
Joined: Mon Jun 27, 2016 7:32 pm

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

#29 Post by Mauser » Tue Feb 06, 2018 11:13 am

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

User avatar
Jerry3904
Forum Veteran
Forum Veteran
Posts: 21793
Joined: Wed Jul 19, 2006 6:13 am

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

#30 Post by Jerry3904 » Tue Feb 06, 2018 11:29 am

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: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, Kingston SSD 120 GB and WesternDigital 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB

Post Reply

Return to “General”