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
chrispop99
Global Moderator
Posts: 3174
Joined: Tue Jan 27, 2009 3:07 pm

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

#31 Post 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
MX Facebook Group Administrator.
Home-built desktop - Core i5 9400, 970 EVO Plus, 8GB
DELL XPS 15
Lots of test machines

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

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

#32 Post 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
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
Mauser
Posts: 1359
Joined: Mon Jun 27, 2016 7:32 pm

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

#33 Post 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.
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: 7226
Joined: Sun May 27, 2007 5:37 am

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

#34 Post 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.
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: 1359
Joined: Mon Jun 27, 2016 7:32 pm

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

#35 Post 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.
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
chrispop99
Global Moderator
Posts: 3174
Joined: Tue Jan 27, 2009 3:07 pm

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

#36 Post 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
MX Facebook Group Administrator.
Home-built desktop - Core i5 9400, 970 EVO Plus, 8GB
DELL XPS 15
Lots of test machines

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

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

#37 Post 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.
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
k_sz
Posts: 122
Joined: Mon Jan 29, 2018 7:11 am

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

#38 Post 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.
> Desktop : AMD 64 bits (unknowned monocore model :P looking for an AM2+ 4cores Phenom) | RAM 4Go DDR2 | MX@daily updates, sudo apt dist-upgrade
> Laptop x2 : WIP obsolescence and "old" batteries prices have killed my project

User avatar
chrispop99
Global Moderator
Posts: 3174
Joined: Tue Jan 27, 2009 3:07 pm

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

#39 Post by chrispop99 »

60 is the default.

If you want to check, do this in a terminal:

Code: Select all

cat /proc/sys/vm/swappiness
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
MX Facebook Group Administrator.
Home-built desktop - Core i5 9400, 970 EVO Plus, 8GB
DELL XPS 15
Lots of test machines

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

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

#40 Post by Mauser »

60
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:

Post Reply

Return to “General”