News for hackers. Stuff that matters.
Re:Replacing a $3000/mo Heroku bill with a $55/mo server by collinmanderson on Tuesday October 21, 2025 @08:00PM (#45663334)
Yes. I think might also need to chmod 600 /swapfile. I do this on all my VPS, especially helps for small VPS with only 1GB ram:

   fallocate -l 1G /swapfile
   chmod 600 /swapfile
   mkswap /swapfile
   swapon /swapfile
Works really well with no problems that I've seen. Really helps give a bit more of a buffer before applications get killed. Like others have said, with SSD the performance hit isn't too bad.
Re:Replacing a $3000/mo Heroku bill with a $55/mo server by awesome_dude on Tuesday October 21, 2025 @10:02PM (#45664144)
IME SWAP has been explicitly disabled by the VPS providers.

Partly it's a money thing (they want to sell you RAM), partly it's so that the shared disk isn't getting thrashed by multiple VPS

Re:Replacing a $3000/mo Heroku bill with a $55/mo server by efreak on Wednesday October 22, 2025 @04:02AM (#45666094)
Get better VPS then. Openvz and other kernel paravirtualization have limits, go for Xen or KVM instead (Xen has paravirtualization as well, but I'm not sure how much it's actually used). Full virtualization (implemented by Xen and KVM) do not allow you to prevent swap from being used.
Re:Replacing a $3000/mo Heroku bill with a $55/mo server by collinmanderson on Wednesday October 22, 2025 @01:08PM (#45672114)
I forgot to mention what the parent comment said, yes, need to put something like this in /etc/fstab:

/swapfile swap swap sw 0 0

or via ansible:

    mount:
      src: "/swapfile"
      name: "swap"
      fstype: "swap"
      opts: "sw"
      passno: "0"
      dump: "0"
      state: present