You are not logged in.

#1 2005-05-16 21:21:24

deft
Member
Registered: 2005-03-14
Posts: 79

Swappiness

Hi - Is it ok to use /etc/rc.conf to set swappiness on boot-up - ie setup a parameter like:

vm.swappiness=x

If so, is it ok to put it at the end of the file.

Thanks.

Offline

#2 2005-05-16 21:41:10

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,835

Re: Swappiness

It won't work at the end of rc.conf - you need to put it in rc.local.

Offline

#3 2005-05-16 22:20:59

deft
Member
Registered: 2005-03-14
Posts: 79

Re: Swappiness

Thanks - however, it doesn't work in /etc/rc.local either - it gives

"command not found"

as a last boot up message, just before login - in addition, I tried putting it in:

/etc/sysctl.conf

however, Arch doesn't seem to use this file sad ?? - is it possible to call this file from somewhere? - anyone have any other thoughts.

At the moment my setting is set to 60 (which is the default apparently) - would like to lower this somewhat.

Thanks

Offline

#4 2005-05-16 22:42:08

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Swappiness

1. Create /etc/sysctl.conf and put your settings in it.
2. Add /sbin/sysctl -p to /etc/rc.local.
3. Reboot or run sysctl -p as root.

Offline

#5 2005-05-16 23:06:54

deft
Member
Registered: 2005-03-14
Posts: 79

Re: Swappiness

Cheers Ianrat - that worked perfectly smile - last boot message was;

vm.swappiness=x

without any errors, and checked:

cat /proc/sys/vm/swappiness

and it has changed accordingly.

BTW - what does anyone think - for an ordinary desktop user with say 512 mb ram, would it be useful to reduce it to say

vm.swappiness=10

or 20 etc from the default of 60.

Or does anyone think it's overrated and there'd be little difference in desktop app snappiness/responsiveness/loading.

Does anyone else use this tweak ?

Offline

#6 2005-05-17 08:48:05

blitze
Member
From: Melbourne, Australia
Registered: 2004-03-19
Posts: 54

Re: Swappiness

Seems to work here nicely
Arch Linux
Dual AMD MP 2000
GF 6600GT
1 Gig Ram

etc.
great find and a pity you can't get options for tuning like this with OS installers.  Oh well.


Leave ones footprint not in the physical world but the in the world of the mind.

Offline

#7 2005-05-17 08:58:59

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,835

Re: Swappiness

deft wrote:

Thanks - however, it doesn't work in /etc/rc.local either - it gives

"command not found"

Well, it would do that - wm.swappiness is not a command, after all. You could have done it in rc.local with the following command:

echo x > /proc/sys/vm/swappiness

and I probably should have clarified that for you. Glad you're sorted, anyway.

Offline

#8 2005-05-17 10:18:20

deft
Member
Registered: 2005-03-14
Posts: 79

Re: Swappiness

Thanks all - just as a heads up and for further interest - might be something of use below:

http://www.linuxjournal.com/article/8308
http://kerneltrap.org/node/3000

Offline

#9 2005-05-17 14:11:40

CyberTron
Member
From: Gotland ,Sweden
Registered: 2005-03-17
Posts: 645
Website

Re: Swappiness

this file, swappiness, does one have to install any specific programs for it to show, ??


http://www.linuxportalen.com  -> Linux Help portal for Linux and ArchLinux (in swedish)

Dell Inspiron 8500
Kernel 2.6.14-archck1  (selfcompiled)
Enlightenment 17

Offline

#10 2005-05-17 15:24:10

deft
Member
Registered: 2005-03-14
Posts: 79

Re: Swappiness

As a kernel "feature", you should be able to modify it via a run-time tunable - to start with, open an xterm and as an ordinary user type:

$ cat /proc/sys/vm/swappiness

It should give you a default value of 60.

After you've verified that succesfully - then follow the instructions further up the thread to change it.

Offline

#11 2005-05-17 17:33:05

CyberTron
Member
From: Gotland ,Sweden
Registered: 2005-03-17
Posts: 645
Website

Re: Swappiness

I do not have that file, I have compiled my own kernel, 2.6.11.8 with CKO6 patchset..


http://www.linuxportalen.com  -> Linux Help portal for Linux and ArchLinux (in swedish)

Dell Inspiron 8500
Kernel 2.6.14-archck1  (selfcompiled)
Enlightenment 17

Offline

#12 2005-05-17 18:42:57

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,017

Re: Swappiness

ck patchset uses so-called mapped watermark instead (and actually most of other patchsets use it as well, taking it from ck). It's configurable at /proc/sys/vm/mapped. Check ck's homepage for more info ;-)

Offline

#13 2005-05-17 19:58:31

CyberTron
Member
From: Gotland ,Sweden
Registered: 2005-03-17
Posts: 645
Website

Re: Swappiness

ah..thanks..that does explain it:D


http://www.linuxportalen.com  -> Linux Help portal for Linux and ArchLinux (in swedish)

Dell Inspiron 8500
Kernel 2.6.14-archck1  (selfcompiled)
Enlightenment 17

Offline

Board footer

Powered by FluxBB