Swap is disk space the system uses when it runs out of RAM. /go/swap sets it up for you. It: The swap size and the swappiness value are chosen automatically from the amount of RAM (see the size table). You can't pass your own values. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
/go/swap
Options
None.
Examples
# Create swap (if missing) and set swappiness
/go/swap
# Check the result
swapon --show
cat /proc/sys/vm/swappiness
# Replace the swap file with a new one of the size the command would choose
sudo swapoff /swapfile
sudo rm /swapfile
/go/swap
Output
When it creates a swap file, the command prints the output of mkswap:
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=3f1b6c1e-0c2e-4a3e-9d52-5b1f1c4f7a10
When the server already has swap, the command prints nothing.
Every run is logged to /var/log/go/swap.log with a timestamp and the arguments used.
To check the result:
swapon --show # the active swap file
free -h # RAM and swap totals
cat /proc/sys/vm/swappiness # the current swappiness value
See the full reference at /go/swap and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
