Date created: Wednesday, August 22, 2012 5:37:48 PM. Last modified: Thursday, June 20, 2024 9:20:13 AM

Memory Tuning

Enabling swap partition;

/dev/sda3 swap swap defaults 0 0

Write data and drop page cache, dentries and inodes

sync
echo 3 > /proc/sys/vm/drop_caches

Adjusting memory cache ratios:

# Page out applications as little as possible
sysctl -w vm.swappiness=1
echo "vm.swappiness=1" >> /etc/sysctl.conf
# or
# echo 0 > /proc/sys/vm/swappiness
# Favour inode/dentry cache instead of block cache
sysctl -w vm.vfs_cache_pressure=50

Ref: http://www.kernel.org/doc/Documentation/sysctl/vm.txt


Previous page: Make Bootable USB
Next page: MOTD Script