My Ubuntu server not using available swap, even if OOM. What to do?

January 24, 2014 1.7k views
I recently added 1 GB of swap to my Ubuntu server to prevent MySQL crashes on RAM overloading. I followed this tutorial: I use htop to monitor resources. When I use loadimpact to test my server it crashes when no more RAM is available, but not a single byte of swap is used... I got the current setting now: # swapon -s Filename Type Size Used Priority /var/swap.img file 1023996 0 100 # free total used free shared buffers cached [...] Swap: 999 0 999 /etc/fstab contains: LABEL=DOROOT / ext4 errors=remount-ro 0 1 /var/swap.img none swap defaults,pri=100 0 0 Last note: when I used the tutorial I get the following msg executing "swapon -p 100 /var/swap.img" : swapon: /var/swap.img: swapon failed: Device or resource busy
3 Answers
Does running sysctl vm.swappiness=10 fix it?
Have another answer? Share your knowledge.