Gen 4 VPS & Dedicated Servers Help

Disable swap on my Gen 4 VPS & Dedicated Server

Swap on a server provides additional virtual memory when physical RAM is exhausted, and can be a great troubleshooting tool to temporarily prevent errors or crashing due to memory limitations. However, due to the potential for performance degradation, we highly recommend turning swap off after you’ve optimized your site and server processes.

Warning: This article covers an advanced technical topic. If the steps are completed incorrectly, it's possible to make unwanted changes to your site. Therefore, we strongly recommend creating a backup before you proceed. Please review the full Statement of Support to learn more about available support for additional products and services.
  1. Connect to your server using SSH.
  2. Switch to the root user.
  3. Deactivate swap:
    sudo swapoff -v /swapfile
  4. Using your preferred text editor command, open your /etc/fstab file and remove the following line of code:
    /swapfile swap swap defaults 0 0
  5. Delete the swap file:
    sudo rm /swapfile

More Info

Share this article