You are not logged in.

#1 2013-10-12 03:42:23

iJC
Member
From: Planet Earth
Registered: 2013-03-03
Posts: 22

[SOLVED] [sysctl] Swappiness configuration

Reading the ArchWiki: https://wiki.archlinux.org/index.php/Swap#Swappiness

I found this helpful article, but it refers to "/etc/sysctl.d/99-sysctl.conf". This file doesn't exist, I only have an empty "/etc/sysctl.d/".

And I read that "# echo 1 > /proc/sys/vm/swappiness" is deprecated.

How can I proceed to lower my swap use?

Thanks.

Last edited by iJC (2013-10-12 17:44:54)


KISS Principle

Offline

#2 2013-10-12 03:48:31

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,411

Re: [SOLVED] [sysctl] Swappiness configuration

create the file.

Offline

#3 2013-10-12 03:58:18

iJC
Member
From: Planet Earth
Registered: 2013-03-03
Posts: 22

Re: [SOLVED] [sysctl] Swappiness configuration

Oh, I forgot to mention, some people refers to "50-default.conf" instead of "99-sysctl.conf". Which one should I use in the creation?

Last edited by iJC (2013-10-12 03:58:37)


KISS Principle

Offline

#4 2013-10-12 04:11:31

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] [sysctl] Swappiness configuration

sysctl.d works like systemd units, where the things in /etc/sysctl.d override files of the same name in /usr/lib/sysctl.d.  So unless you want to override all of the things in 50-default.conf, then you should create your own file. 

The ordering has flip-flopped a couple times, but currently if there are settings between the files that are trying to control the same thing, then the file that is parsed lexicographically later will be honored.  Hence the use of 99.  Hopefully this won't change again.

Offline

#5 2013-10-12 12:12:50

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED] [sysctl] Swappiness configuration

Thanks WonderWoofy, that explains why my 49-coredump.conf file to restore normal core files was ignored :-/. Fixed now!

iJC, where did you read that "echo 1 > /proc/sys/vm/swappiness" is deprecated? Sometimes some early adopters like to spread FUD about perfectly working features just because they think the new way is better…

Offline

#6 2013-10-12 17:44:39

iJC
Member
From: Planet Earth
Registered: 2013-03-03
Posts: 22

Re: [SOLVED] [sysctl] Swappiness configuration

@stqn: I really don't remember the name, but it was a Linux forum.

Thanks for the help guys.

[SOLVED]

Last edited by iJC (2013-10-12 17:45:04)


KISS Principle

Offline

#7 2013-10-12 18:34:29

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] [sysctl] Swappiness configuration

stqn wrote:

iJC, where did you read that "echo 1 > /proc/sys/vm/swappiness" is deprecated? Sometimes some early adopters like to spread FUD about perfectly working features just because they think the new way is better…

It is not deprecated in the sense that echo'ing values into a /sys file is not supported or won't work any longer.  But rather, systemd does not provide anything like SysV's /etc/rc.local, where people used to dump various commands like that and tout it as correct configuration.  In reality, that was never really the proper way to do things, but for most things it worked.  So I can see if viewed in that regard, it could be seen as deprecated in a way.

For me personally, I would just rather gain understanding of what might be setting things in the first place and (hopefully) adjust them with those tools.  But I can also understand that someone who has no strong desire to really learn about the inner working of their system might want to take an /etc/rc.local like route, and it is fast and (usually) effective.  Though around here, I would hope that people would be willing to take the time to learn how to avoid using hacks like that… this is Arch Linux after all.

Offline

Board footer

Powered by FluxBB