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
chrispop99
Forum Guide
Forum Guide
Posts: 2516
Joined: Tue Jan 27, 2009 3:07 pm

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

#31 Post by chrispop99 » Tue Feb 06, 2018 11:31 am

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
Test machines:
32-bit non-PAE - Thinkpad T41, 1.6GHz Pentium M, 1GB RAM.
32-bit PAE - DELL Latitude D610, 1.73GHz Pentium M, 2GB RAM.
64-bit - Lenovo T61, 2GHz Core 2 Duo, 2GB RAM
64-bit - Gigabyte Z77P-D3, Intel i3-3220, GeForce 8400 GS, 4GB PC3-12800.

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

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

#32 Post by Mauser » Tue Feb 06, 2018 11:39 am

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

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

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

#33 Post by Mauser » Tue Feb 06, 2018 11:44 am

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.

User avatar
asqwerth
Forum Veteran
Forum Veteran
Posts: 3682
Joined: Sun May 27, 2007 5:37 am

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

#34 Post by asqwerth » Tue Feb 06, 2018 11:55 am

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

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

#35 Post by Mauser » Tue Feb 06, 2018 11:58 am

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.

User avatar
chrispop99
Forum Guide
Forum Guide
Posts: 2516
Joined: Tue Jan 27, 2009 3:07 pm

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

#36 Post by chrispop99 » Tue Feb 06, 2018 12:39 pm

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
Test machines:
32-bit non-PAE - Thinkpad T41, 1.6GHz Pentium M, 1GB RAM.
32-bit PAE - DELL Latitude D610, 1.73GHz Pentium M, 2GB RAM.
64-bit - Lenovo T61, 2GHz Core 2 Duo, 2GB RAM
64-bit - Gigabyte Z77P-D3, Intel i3-3220, GeForce 8400 GS, 4GB PC3-12800.

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

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

#37 Post by Mauser » Tue Feb 06, 2018 1:54 pm

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.

User avatar
k_sz
Forum Regular
Forum Regular
Posts: 171
Joined: Mon Jan 29, 2018 7:11 am

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

#38 Post by k_sz » Tue Feb 06, 2018 2:01 pm

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 | MX17.1@daily updates
> Laptop : Work In Progress, Celeron monocore | DDR2 | Probably antiX ^^

User avatar
chrispop99
Forum Guide
Forum Guide
Posts: 2516
Joined: Tue Jan 27, 2009 3:07 pm

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

#39 Post by chrispop99 » Tue Feb 06, 2018 2:17 pm

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
Test machines:
32-bit non-PAE - Thinkpad T41, 1.6GHz Pentium M, 1GB RAM.
32-bit PAE - DELL Latitude D610, 1.73GHz Pentium M, 2GB RAM.
64-bit - Lenovo T61, 2GHz Core 2 Duo, 2GB RAM
64-bit - Gigabyte Z77P-D3, Intel i3-3220, GeForce 8400 GS, 4GB PC3-12800.

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

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

#40 Post by Mauser » Tue Feb 06, 2018 2:23 pm

60

Post Reply

Return to “General”