I recently added 1 GB of swap to my Ubuntu server to prevent MySQL crashes on RAM overloading. I followed this tutorial: https://www.digitalocean.com/community/articles/how-to-configure-virtual-memory-swap-file-on-a-vps.
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:
Filename Type Size Used Priority /var/swap.img file 1023996 0 100
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
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.