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
skidoo
Forum Regular
Forum Regular
Posts: 863
Joined: Tue Sep 22, 2015 6:56 pm

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

#41 Post by skidoo » Tue Feb 06, 2018 5:54 pm

Instead of manually editing the conf file, you can add (append) via

Code: Select all

sudo echo "vm.swappiness = 10" >> /etc/sysctl.conf
(10, or zero, or whatever value you choose)

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

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

#42 Post by Mauser » Tue Feb 06, 2018 7:26 pm

skidoo wrote:Instead of manually editing the conf file, you can add (append) via

Code: Select all

sudo echo "vm.swappiness = 10" >> /etc/sysctl.conf
(10, or zero, or whatever value you choose)
I don't understand.

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

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

#43 Post by Kestrel » Tue Feb 06, 2018 9:24 pm

Mauser you say you read the following link which I posted earlier in this thread.

https://sites.google.com/site/easylinux ... swappiness

It explains it pretty simply. Anyone with 4gb of ram or more need not bother decreasing the swappiness as their systems will seldom use the swap partition anyway. I have not bothered decreasing it in MX because I have 8gb ram but I did decrease it to 1 when I only had 3gb of ram so that my system would use the swap partition only when absolutely necessary, the higher value your swappiness is set to the more your system will tend to use the swap partition rather than the ram.

Skidoo is telling you how to change the swappiness figure in the file via the command line rather than actually opening the file in an editor. The sudo command enables you to edit that file as root from the command line without you needing to manually go to the file, but it seems from your earlier posts you have been manually navigating to the file in a file browser and trying to edit it that way.
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
Richard
Posts: 2072
Joined: Fri Dec 12, 2008 10:31 am

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

#44 Post by Richard » Tue Feb 06, 2018 9:41 pm

How to set swappiness, 2 p's & 3 s's

# Read current setting:
$ cat /proc/sys/vm/swappiness
# returns current, default=60

# change value for this session, as root:
echo 50 > /proc/sys/vm/swappiness
# then, to verify;
cat /proc/sys/vm/swappiness
# should return 50


If convinced it can be made permanent.

# to change permanently:
# open Thunar
# navigate to /etc/sysctl.conf
# the file, not the folder
# highlight the file, right click, Edit as Root
# scroll to end of file, add the following
# line to the end of file,
# before exit, if it exists,l
# as follows (for SSD)
vm.swappiness=1

# test with
cat /proc/sys/vm/swappiness
# if it doesn't indicate the changed value,
# then probably have to reboot to read in
# the new value
# I don't remember if I actually checked. again.
# my T430 with small SSD, running with
# vm.swappiness=1

# if correct or satisfied, then
# reboot and test again with
cat /proc/sys/vm/swappiness
# should return the value you entered.
Last edited by Richard on Thu Feb 15, 2018 12:13 am, edited 1 time in total.
MX171: Lenovo T430: Intel DualCore i5-3320M, 8 GB RAM, 4.18.7-antix.1-amd64-smp, 119GB SSD
MX171: AA1-ZG5/EeePC-1005HA: DualCore N270, 1 GB RAM, 4.9.126-antix.1-686-smp-pae, 150GB HDD
Doublecmd84, LibO61, Dropbx, PMoon, CherryT,Vbox. LinuxCounter #208633

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

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

#45 Post by Mauser » Wed Feb 07, 2018 6:57 pm

I got it to change. :) At first sudo echo "vm.swappiness = 10" >> /etc/sysctl.conf didn't work after I checked it. Then I went to do it as Richard said and found it was change already. Then I conformed it in the terminal. Mine is set to 10 now. :) Thank you everyone.

User avatar
Protokol
Forum Novice
Forum  Novice
Posts: 13
Joined: Fri Apr 13, 2018 10:46 am

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

#46 Post by Protokol » Wed May 02, 2018 4:58 am

Hello,

I have an old asus laptop (10 years old) 32 bits with 2 gb of ram and a ssd disk
my actual swappiness settings are :
vm.swappiness = 90
vm.overcommit_memory = 0
vm.overcommit_ratio = 90

What do you think of it? is it a good settings? maybe a way to optimize it?
Laptop ASUSTeK product: F7F 2008 Intel Core Duo T2250
Kernel: 4.15.0-1-686 i686 32 bits
Desktop: Xfce 4.12.3 Distro: MX-17_386 Horizon December 15, 2017
Graphics: Intel Mobile 945GM/GMS 943/940GML
Ram : 2GB

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

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

#47 Post by stsoh » Wed May 02, 2018 5:35 am

dont tweak overcommit, set at default.
run zram and zswap, set swappiness=100.
https://mxlinux.org/wiki/other/zram

Code: Select all

$ dmesg|grep swap
[    0.600060] zswap: loaded using pool lzo/zbud
[    2.515565] Adding 2033776k swap on /dev/zram0.  Priority:100 extents:1 across:2033776k SSFS
[    2.525206] Adding 2033776k swap on /dev/zram1.  Priority:100 extents:1 across:2033776k SSFS
Last edited by stsoh on Wed May 02, 2018 5:46 am, edited 1 time in total.
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
cyrilus31
Forum Regular
Forum Regular
Posts: 547
Joined: Thu Nov 03, 2016 3:24 pm

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

#48 Post by cyrilus31 » Wed May 02, 2018 5:39 am

Protokol wrote:Hello,

I have an old asus laptop (10 years old) 32 bits with 2 gb of ram and a ssd disk
my actual swappiness settings are :
vm.swappiness = 90
vm.overcommit_memory = 0
vm.overcommit_ratio = 90

What do you think of it? is it a good settings? maybe a way to optimize it?
Default vm.swappiness value is 60. 90 means that you swap when 90% of your ram is left. You should change this value to 10 instead.
As for your other entries, I don't know and will wait to see if I can tweak more my install :happy:

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1724
Joined: Wed Apr 11, 2018 5:09 pm

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

#49 Post by fehlix » Wed May 02, 2018 6:12 am

This about the command you tried

Code: Select all

sudo echo "vm.swappiness = 10" >> /etc/sysctl.conf
Well the correct command line would read like this

Code: Select all

sudo sh -c 'echo "vm.swappiness = 10" >> /etc/sysctl.conf'
Spott the difference!
The redirect '>>' running in the user context of the first command will fail due to permssion error.
A nice liitle alternative:

Code: Select all

echo "vm.swappiness = 10" | sudo tee -a /etc/sysctl.conf 
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
Protokol
Forum Novice
Forum  Novice
Posts: 13
Joined: Fri Apr 13, 2018 10:46 am

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

#50 Post by Protokol » Wed May 02, 2018 6:25 am

Thanks to all, I will test and see what happens...
Laptop ASUSTeK product: F7F 2008 Intel Core Duo T2250
Kernel: 4.15.0-1-686 i686 32 bits
Desktop: Xfce 4.12.3 Distro: MX-17_386 Horizon December 15, 2017
Graphics: Intel Mobile 945GM/GMS 943/940GML
Ram : 2GB

Post Reply

Return to “General”