Page 1 of 1
What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 1:19 pm
by mmikeinsantarosa
An interesting read about how to adjust your distros'
swappiness. Anybody ever tinker with this? My m12 is set to 60. As far as swap size goes, the author suggests:
This is a dedicated space in your hard drive that is usually set to at least twice the capacity of your RAM
Happy Friday!
- mike
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 1:28 pm
by chrispop99
As I run with plenty of RAM, I always set it to 10. I understand that's a good idea for SSD users also.
Chris
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 1:34 pm
by Eadwine Rose
2 gigs, it's more than plenty.
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 1:40 pm
by mmikeinsantarosa
from the article
The swappiness parameter value is stored in a simple configuration text file located in /proc/sys/vm and is named “swappiness”.
Anybody ever tinker with their "swappiness" setting?
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 1:42 pm
by Eadwine Rose
Oh wait.. you are not talking about plain jane swap partition?
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 1:44 pm
by Adrian
Eadwine Rose wrote:Oh wait.. you are not talking about plain jane swap partition?
It explains in the article, swappiness is a parameter that tells the computer when to swap stuff, by default is 60 so it starts to swap out (write inactive part of the memory to the swap space) when the free memory drops to 60%. If you set swappiness 10 then the computer will start to swap only when the free memory drops to 10%.
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 1:47 pm
by Jerry3904
Eadwine Rose wrote:Oh wait.. you are not talking about plain jane swap partition?
I misunderstood that too, and thought misr was trying to make a funny with the language...
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 2:00 pm
by Eadwine Rose
Indeed!

Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 2:03 pm
by lucky9
I run the default in all of my operating systems. I've never seen SWAP used in my normal day to day use pattern. Matter of fact I've never seen SWAP used when I've checked memory usage. (I currently have 8 GB of RAM, but never noticed a use when I had 4 GB.)
I do not use anything but up and running or off.
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 2:16 pm
by kmathern
lucky9 wrote:I run the default in all of my operating systems. I've never seen SWAP used in my normal day to day use pattern. Matter of fact I've never seen SWAP used when I've checked memory usage. (I currently have 8 GB of RAM, but never noticed a use when I had 4 GB.)
I do not use anything but up and running or off.
My machine has 4GB of RAM, but some of it is being used as video memory.
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.
Code: Select all
$ free -h
total used free shared buffers cached
Mem: 3.2G 2.6G 593M 0B 189M 920M
-/+ buffers/cache: 1.5G 1.7G
Swap: 8.2G 84M 8.2G
I sized my swap partition at 8.2GB, just a little more than my machines 8GB RAM capacity
(if I were to add another ram module).
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 4:11 pm
by Gordon Cooper
Must say that I have never looked to see if swap is being used, have always set it well above the RAM, possibly remembering a few years
back when I was testing a CAD program update before it was released. Running on Win XP, it had been going about 5 minutes when everything went very slow. So I doubled the virtual memory - a piece of HD allocated for the job. This time, slow after 10 minutes, then became worse. Eventually discovered that the author had omitted the codes to clear temporary memory after each calculation so RAM filled up then the virtual memory, no matter how big it was.
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 4:43 pm
by joany
The default value of 60 seems awfully high to me. I don't want my HDD thrashing around until the free memory gets down to 10% or so. With 4GB of installed RAM (minus a small amount used for video), I've seldom seen swap used running Linux unless I'm running resource-hungry applications like Snapshot and DeVeDe or when I've allocated 2GB of RAM to a VM running in VirtualBox. Windows used swap all the time, which resulted in a lot of thrashing. I pointed the Windows swapfile to the secondary HDD, to make life easier for the main HDD. Of course I don't run Windows at all any more, so my HDDs should last a long time (knock on wood).
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 5:55 pm
by lucky9
Code: Select all
$ free -h
total used free shared buffers cached
Mem: 7.9G 2.4G 5.5G 0B 145M 1.2G
-/+ buffers/cache: 1.1G 6.8G
Swap: 8.0G 0B 8.0G
This is from a normal session for me.
Re: What's your swappiness set to, eh?
Posted: Fri Jun 19, 2015 11:44 pm
by antiX-Dave
I generally work with a kind of mental ratio or balance with swappiness and swap size. No real reason and do not know if it is actually a good way to do things. Just seems to work out well for my figuring.
I like to keep the memory allocation around 4gb total, more is ok.
So for a machine with 1 gb ram I try around 3gb swap, default swappiness
A machine with 2 gb ram, 2gb swap, 50 swappiness
A machine with 3 gb ram 1gb swap, 25 swappiness
4 and up 1gb swap, 10 or less swappiness. The swap I find is just to keep things happy. I don't really think swap is needed at 4gb and above ram for most purposes... but I have seen machines still have plenty of free ram and yet still display hanging / delayed actions due to a lack of swap.
Re: What's your swappiness set to, eh?
Posted: Sat Jun 20, 2015 12:37 am
by Gordon Cooper
In Linux, does the swappiness remain at the set %, or can it vary because of coding in application software?
Re: What's your swappiness set to, eh?
Posted: Sat Jun 20, 2015 12:50 am
by lucky9
I doubt that applications have any say at all concerning SWAP. That's OS territory.
I've never run without a SWAP. But I used to (long time ago) have problems occasionally when I had two. Per the free -h I have a total of 8 GB due to two disks. sdb was auto partitioned/installed by the Installer I was using having given it the whole disk to auto-install. I've not had any problems with two SWAP partitions in many years.
Re: What's your swappiness set to, eh?
Posted: Sat Jun 20, 2015 1:42 am
by Gordon Cooper
Thanks Lucky. Have never had any Swap problems myself, but remembering past XP experiences, was wondering if Swap was completely
managed by the OS, or if a badly written app could rock the boat. On this machine there's more Gigs that I would ever use, so have Swap set to 10 Gigs and I just don't worry about it.
Re: What's your swappiness set to, eh?
Posted: Sat Jun 20, 2015 4:34 am
by MX-tester
I have machines used for desktop purposes only, (internet, music, movies, etc), & which have 1GB of ram & no swap at all, I don't have any problems using them on a daily basis.
Re: What's your swappiness set to, eh?
Posted: Sat Jun 20, 2015 8:18 am
by Adrian
I doubt that applications have any say at all concerning SWAP. That's OS territory.
I don't think apps do that regularly, but you can technically have an app running as root modify the swappiness. Let's say that there's a tool that needs for some reason to modify the swappiness, it can simply call this command "sysctl vm.swappiness=xx"
Re: What's your swappiness set to, eh?
Posted: Sat Jun 20, 2015 10:25 am
by whell
Code: Select all
total used free shared buffers cached
Mem: 1.9G 1.6G 286M 0B 21M 1.4G
-/+ buffers/cache: 249M 1.7G
Swap: 7.9G 81M 7.8G
This is with MX-14's default setting.
Re: What's your swappiness set to, eh?
Posted: Sat Jun 20, 2015 9:14 pm
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.
Re: What's your swappiness set to, eh?
Posted: Mon Feb 05, 2018 11:40 am
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.
Re: What's your swappiness set to, eh?
Posted: Mon Feb 05, 2018 10:13 pm
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.
Re: What's your swappiness set to, eh?
Posted: Mon Feb 05, 2018 10:42 pm
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.
Re: What's your swappiness set to, eh?
Posted: Mon Feb 05, 2018 11:03 pm
by Mauser
[quote="asqwerth"][/quote] Thank you for explaining. How do I set that?
Re: What's your swappiness set to, eh?
Posted: Mon Feb 05, 2018 11:20 pm
by asqwerth
Check the link in the first post of this thread.
Re: What's your swappiness set to, eh?
Posted: Mon Feb 05, 2018 11:45 pm
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.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 1:56 am
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'.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 10:13 am
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
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 10:29 am
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
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 10:31 am
by chrispop99
Mauser wrote: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
It's a file, not a folder.
In /etc, scroll right down past the folders to the files. (It's been there in every version of MX, and other distros I've run.)
Changing swappiness doesn't make a huge difference to performance, but is worth doing if you are using as SSD, just to keep writes to a minimum.
Chris
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 10:39 am
by Mauser
Jerry3904 wrote: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
Thanks found the folder but there are no settings for it. This is what it says in there. #
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
# See
http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1
# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1
###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
###################################################################
# Magic system request Key
# 0=disable, 1=enable all
# Debian kernels have this set to 0 (disable the key)
# See
https://www.kernel.org/doc/Documentation/sysrq.txt
# for what other values do
#kernel.sysrq=1
###################################################################
# Protected links
#
# Protects against creating or following links under certain conditions
# Debian kernels have both set to 1 (restricted)
# See
https://www.kernel.org/doc/Documentation/sysctl/fs.txt
#fs.protected_hardlinks=0
#fs.protected_symlinks=0
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 10:44 am
by Mauser
chrispop99 wrote:Mauser wrote: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
It's a file, not a folder.
In /etc, scroll right down past the folders to the files. (It's been there in every version of MX, and other distros I've run.)
Changing swappiness doesn't make a huge difference to performance, but is worth doing if you are using as SSD, just to keep writes to a minimum.
Chris
Thanks. But it looks like it's more trouble than it's worth as there are no settings when I get to it.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 10:55 am
by asqwerth
You're supposed to edit the said file in root to add the line of text as set out in the link in the first post.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 10:58 am
by Mauser
asqwerth wrote:You're supposed to edit the said file in root to add the line of text as set out in the link in the first post.
Thanks, I opened it in root but there was nothing to edit that said anything about swap. I am going to leave it alone. Too much trouble. Thanks anyway.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 11:39 am
by chrispop99
Mauser wrote:asqwerth wrote:You're supposed to edit the said file in root to add the line of text as set out in the link in the first post.
Thanks, I opened it in root but there was nothing to edit that said anything about swap. I am going to leave it alone. Too much trouble. Thanks anyway.
If you had read the linked article about setting swappiness in 'Mint', you would have seen that you
create the swappiness entry by copying/pasting the information.
Chris
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 12:54 pm
by Mauser
chrispop99 wrote:Mauser wrote:asqwerth wrote:You're supposed to edit the said file in root to add the line of text as set out in the link in the first post.
Thanks, I opened it in root but there was nothing to edit that said anything about swap. I am going to leave it alone. Too much trouble. Thanks anyway.
If you had read the linked article about setting swappiness in 'Mint', you would have seen that you
create the swappiness entry by copying/pasting the information.
Chris
I read it and there is nothing on my computer that indicates what it's set to. If default is 60 then I guess it's 60, but I don't know.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 1:01 pm
by k_sz
mmikeinsantarosa wrote:An interesting read about how to adjust your distros'
swappiness. Anybody ever tinker with this? My m12 is set to 60. As far as swap size goes, the author suggests:
This is a dedicated space in your hard drive that is usually set to at least twice the capacity of your RAM
Happy Friday!
- mike
Happy Tuesday ! lolx2.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 1:17 pm
by chrispop99
60 is the default.
If you want to check, do this in a terminal:
It will return 60.
There is more detailed information here. It was written a while ago, so might be less relaxant to modern hardware, but still worth reading:
https://rudd-o.com/linux-and-free-softw ... o-fix-that
Chris
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 1:23 pm
by Mauser
60
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 4:54 pm
by skidoo
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)
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 6:26 pm
by Mauser
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.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 8:24 pm
by Kestrel
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.
Re: What's your swappiness set to, eh?
Posted: Tue Feb 06, 2018 8:41 pm
by Richard
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.
Re: What's your swappiness set to, eh?
Posted: Wed Feb 07, 2018 5:57 pm
by Mauser
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.
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 4:58 am
by Protokol
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?
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 5:35 am
by stsoh
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
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 5:39 am
by cyrilus31
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

Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 6:12 am
by fehlix
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
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 6:25 am
by Protokol
Thanks to all, I will test and see what happens...
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 7:39 am
by stsoh
u can change zswap compression/pool.
Code: Select all
user@mx:~/Desktop
$ dmesg|grep zswap
[ 0.601029] zswap: loaded using pool lz4/z3fold
user@mx:~/Desktop
$ dmesg|grep zram
[ 2.501444] zram: Added device: zram0
[ 2.501508] zram: Added device: zram1
[ 2.509363] zram0: detected capacity change from 0 to 2082590720
[ 2.518401] Adding 2033776k swap on /dev/zram0. Priority:100 extents:1 across:2033776k SSFS
[ 2.522757] zram1: detected capacity change from 0 to 2082590720
[ 2.527645] Adding 2033776k swap on /dev/zram1. Priority:100 extents:1 across:2033776k SSFS
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 8:40 am
by cyrilus31
@stsoh : is there any reason I should tinker with zram if I never use swap (2Go of ram, no VM, very basic needs with this rig) ?
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 8:53 am
by Protokol
@stsoh
thanks! I've activated zram with the help of your technical link
Code: Select all
dmesg|grep zswap
[ 3.863758] zswap: loaded using pool lzo/zbud
dmesg|grep zram
[ 13.242095] zram: Added device: zram0
[ 13.244130] zram: Added device: zram1
[ 13.271715] zram1: detected capacity change from 0 to 263331840
[ 13.311881] Adding 257156k swap on /dev/zram1. Priority:100 extents:1 across:257156k SSFS
dmesg|grep swap
[ 3.863758] zswap: loaded using pool lzo/zbud
[ 9.084972] Adding 4527744k swap on /dev/sda2. Priority:-2 extents:1 across:4527744k SSFS
[ 13.311881] Adding 257156k swap on /dev/zram1. Priority:100 extents:1 across:257156k SSFS
cat /proc/sys/vm/swappiness
100
Now on, I can watch a tv program through a firefox app and at the same time 15 tabs open on palemoon browser, with no lag at all. Just the fan remember me to calm down a litle bit... but that's normal !
Will test a further bit to see

Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 9:10 am
by stsoh
cyrilus31 wrote:@stsoh : is there any reason I should tinker with zram if I never use swap (2Go of ram, no VM, very basic needs with this rig) ?
processes a lot faster on ram, without a doubt, even it doesn't swap. i set 4gb zram, doesn't swap but run smoother n faster than without. with 8gb physical ram plus 4gb zram = 12gb (well, system shows 11gb).
Code: Select all
$ free -ht
total used free shared buff/cache available
Mem: 7.8G 1.6G 4.6G 111M 1.5G 5.8G
Swap: 3.9G 0B 3.9G
Total: 11G 1.6G 8.5G
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 9:31 am
by stsoh
u can set zram size larger by editing /etc/init.d/zram file.
use thunar to open n edit zram, change fraction=25 to 50.
gives better performance.
Re: What's your swappiness set to, eh?
Posted: Wed May 02, 2018 11:14 am
by stsoh
another tip for those installed mx on ssd, activate tmpfs for tmp folder on memory.
on document, tmpfs for run, lock and shm are set 'ON' by default but not tmp (default is 'OFF').
tmp is on ssd/hdd, in case of outage can be recover otherwise will be gone.
only for those interested (like me), do not want to wear down ssd n have running tmp on memory.
open thunar, edit /etc/fstab file, copy n paste below to eol (end-of-line) n save.
Code: Select all
tmpfs /var/tmp tmpfs rw,nodev,nosuid,mode=1777 0 0
Re: What's your swappiness set to, eh?
Posted: Fri May 04, 2018 4:29 am
by Protokol
hello @stsoh
I followed all your tips and I'm very pleased with it, all is working great,
Big thanks for your help !

Re: What's your swappiness set to, eh?
Posted: Fri May 04, 2018 4:44 am
by grelos
I do not use any swap partition. No need.
Re: What's your swappiness set to, eh?
Posted: Fri May 04, 2018 5:59 am
by stsoh
i got no swap partition too, my e5400 can't compare to your i7.
i run zswap n zram plus tmpfs for tmp, performance r smoother n faster when it is processed on memory.
write lesser on ssd.
