Improve performance on Linux VM or Physical machines
1 Inspect your current configuration
If you have logical volumes, do as follow. Otherwise look at the instructions for resizing swap partitions. $> cat /etc/fstab # /etc/fstab /dev/mapper/vg_centos-lv_root / ext4 defaults 1 1 UUID=963b29a5-578a-4d05-bfb4-95d42057df57 /boot ext4 defaults 1 2 /dev/mapper/vg_centos-lv_swap swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0
2. Turn swap off
$> sudo swapoff -v /dev/mapper/vg_centos-lv_swap
3. Reduce SWAP space to 2GB and re-enable
$> sudo lvm lvresize /dev/mapper/vg_centos-lv_swap -L 2Gmkswap /dev/mapper/vg_centos-lv_swap
$> sudo
$> sudo swapon -va
4. Improve performances with tuning
Add the following to /etc/rc.local to execute on system startup:
# Set the size of your IO Buffers to some reasonable amount:
echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes
# Set the swapiness to some reasonable amount.
sysctl -w vm.swappiness=10
Recent Comments