Change Swappiness

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
alaskale
Level 1
Level 1
Posts: 4
Joined: Thu May 28, 2009 9:07 pm

Change Swappiness

Postby alaskale » Thu May 28, 2009 9:54 pm

I've recently switched to Linux mint and have thus far thoroughly enjoyed it. It runs what I would estime as 20% faster on my machine than Ubuntu, and I was able to jump right in. Ndiswrapper and all the codecs I need already installed.

However, on Jaunty I had learned to change the Swappiness priority and found that it really did help. However, on LM I have been unable to do that as I would have on Ubuntu.

I use this guide: http://www.chinwong.com/index.php?/site ... d_up_tips/

Would simply adding the vm.swappines value do the trick, or is there more to it?

Thanks for helping me out,

-Dominick

User avatar
merlwiz79
Level 10
Level 10
Posts: 3476
Joined: Wed Apr 04, 2007 1:50 pm
Location: Here again :)

Re: Change Swappiness

Postby merlwiz79 » Thu May 28, 2009 10:33 pm

Code: Select all

gksu gedit /etc/sysctl.conf

Add to the bottom:

Code: Select all

vm.swappiness=10
Restart sysctl

Code: Select all

sudo sysctl -p
To test if it worked after reboot run

Code: Select all

cat /proc/sys/vm/swappiness

You should see 10.
Image

User avatar
Fred
Level 10
Level 10
Posts: 3351
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Change Swappiness

Postby Fred » Thu May 28, 2009 10:39 pm

alaskal,

I took the below quote from the link you posted. I made a couple corrections and clarifications, which are in bold.

To make sure the system always uses a swappiness of 10 on every boot, we’ll need to edit the sysctl.conf file in the etc directory. To do this, type:

gksu gedit /etc/sysctl.conf

This will call up a text editor with the configuration file. Find the line that says “vm.swappiness=60” without the quotes, and change the 60 to 10, taking care to change nothing else in the file. If this line isn't in the file, add it. Save the file and reboot, you’re done.


Unless Mint 7 is not using this structure anymore you should be good to go.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.

User avatar
Fred
Level 10
Level 10
Posts: 3351
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Change Swappiness

Postby Fred » Thu May 28, 2009 10:41 pm

merlwiz79,

Oops, sorry. I didn't see your post before I submitted. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.

alaskale
Level 1
Level 1
Posts: 4
Joined: Thu May 28, 2009 9:07 pm

Re: Change Swappiness

Postby alaskale » Thu May 28, 2009 11:51 pm

I just got home and was surprised to see such fast replies.

Thank you for your assistance!

:D

User avatar
linuxviolin
Level 8
Level 8
Posts: 2071
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: Change Swappiness

Postby linuxviolin » Fri May 29, 2009 12:11 am

If you have more than 1 or 2 GB of RAM you should choose 0, or 1... And change vfs_cache_pressure to 50.
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)

alaskale
Level 1
Level 1
Posts: 4
Joined: Thu May 28, 2009 9:07 pm

Re: Change Swappiness

Postby alaskale » Fri May 29, 2009 12:25 am

I have 2 GB of ram. how do I change the vfs_cache_pressure?

User avatar
linuxviolin
Level 8
Level 8
Posts: 2071
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: Change Swappiness

Postby linuxviolin » Fri May 29, 2009 12:39 am

Like for swappiness. Add in sysctl.conf a line: vm.vfs_cache_pressure = 50
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)


Return to “Newbie Questions”

Who is online

Users browsing this forum: bushyiii, Sgthawker and 6 guests