User: Password:
|
|
Subscribe / Log in / New account

How do you set 'swappiness'?

How do you set 'swappiness'?

Posted May 6, 2004 16:19 UTC (Thu) by southey (subscriber, #9466)
Parent article: 2.6 swapping behavior

As a ordinary user (with root access), how do you actually set swappiness? Especially every reboot. Also, what performance problems would be expected? I would there just be intense disk swapping when required.


(Log in to post comments)

How do you set 'swappiness'?

Posted May 6, 2004 16:27 UTC (Thu) by corbet (editor, #1) [Link]

To set it to zero, type:

    echo 0 > /proc/sys/vm/swappiness

All there is to it.

How do you set 'swappiness'?

Posted May 6, 2004 17:32 UTC (Thu) by southey (subscriber, #9466) [Link]

Many thanks, I'll give it a whirl. It is not always clear what to do for less technical user. This is one of the best sections on Linux (web or print based) that allows at least me to understand what the kernel is and what is it doing in the past, present and future!

How do you set 'swappiness'?

Posted May 6, 2004 17:38 UTC (Thu) by thomas_d_stewart (subscriber, #4328) [Link]

And if you want it set at every reboot try:-

echo "vm/swappiness=0" >> /etc/sysctl.conf

(Thats how to do it in debian and fedora, its part of the procpc package)

HTH
--
Tom

How do you set 'swappiness'?

Posted May 13, 2004 22:55 UTC (Thu) by ArsonSmith (guest, #5695) [Link]

edit /etc/sysctl.conf

add:
vm.swappiness = <value>

replace <value> with a number 1 to 100

Many people say just to add an echo <value> > /proc/sys/vm/swappiness

but this wont persist after a reboot. sysctl is a utility provided by most distributions to set this up after reboot. You can also see what all the configurable peramiters are but running

sysctl -A

I am a fan of sysctl as it also keeps your runtime kernel configuration stuff in a central location /etc/sysctl.conf and not in various places /etc/init.d/kernel_custom_stuff or /etc/rc5.d/local or what ever other places people like to make up to put this kind of stuff.

How do you set 'swappiness'?

Posted May 13, 2004 22:56 UTC (Thu) by ArsonSmith (guest, #5695) [Link]

Sorry that should be value 0-100 not 1-100


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds