VectorLinux

The nuts and bolts => Portable VL => Topic started by: silentstone on November 24, 2007, 08:52:48 am

Title: Optimizing system swappiness...whereis sysctl.conf?
Post by: silentstone on November 24, 2007, 08:52:48 am
I'm trying to eek the last bit of power out of the laptop battery, and turn down the temperature, too.  Several optimization guides suggest lowering swappiness to below 20 by modifying /etc/sysctl.conf, but this file is missing in my VL5.8 Standard install.  The setting can be changed manually by writing the desired number to the file /proc/sys/vm/swappiness, but this is erased on a reboot.  How do I set this value automatically?
Title: Re: Optimizing system swappiness...whereis sysctl.conf?
Post by: The Headacher on November 24, 2007, 09:03:43 am
Have you tried making a new file? Just because a file isn't there doesn't mean you can't use it. read "man sysctl.conf" for it's syntax.
Title: Re: Optimizing system swappiness...whereis sysctl.conf?
Post by: newt on November 24, 2007, 10:04:20 am
The comments section from this link (http://lwn.net/Articles/83588/) specifies creating a file the following way, however the file may need to already exists (don't know):
Quote
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!
Title: Re: Optimizing system swappiness...whereis sysctl.conf?
Post by: The Headacher on November 24, 2007, 10:37:56 am
the ">>" operator will make sure it's added to the end of the file. If it doesn't exist a new file will be created.
Title: Re: Optimizing system swappiness...whereis sysctl.conf?
Post by: silentstone on February 20, 2008, 08:45:41 am
Well, this feels belated, but...

Thanks for the tips; they helped!