Modify Your Swapfile For Better Performance
Posted By Chinmoy Kanjilal On August 7, 2009 @ 9:32 am In Open Source Software | 1 Comment
A swap file is an area on your hard-disk where the computer continuously keeps storing data which is not in immediate use. Now, a drive failure of the swap partition can cause some applications which require high amount of swap memory to crash.
There are two workarounds to this :
sysctl vm.swappiness=desired swappiness
Here, replace ‘desired swappiness’ with a desired value between 0 to 100. 0 indicates no swap usage, thereby running everything on the RAM, unless absolutely necessary, 100 indicates immediate swapping.For this to take effect without a reboot, run
swapoff -a
and
swapon -a
as root.
dd if=/dev/zero of=/swapfile bs=1048576 count=1000
mkswap /swpf
swapon /swpf
/swapfile swap swap defaults 0
to the file /etc/fstab for doing this permanently.
swapon -s
That is all. Get a better and faster debian based system in a few seconds, without any restart.
Article printed from Techie Buzz: http://techie-buzz.com
URL to article: http://techie-buzz.com/foss/modify-your-swap-file-for-better-performance.html
Click here to print.
Copyright © 2006-20011 Techie Buzz. All rights reserved.