2 hours ago · Tech · hide · 0 comments

My IONOS VPS has been suddenly going unresponsive lately. I told Gemini I have this VPS for editing files in Neovim, and it suggested I might be running out of memory, especially if I’m running a TypeScript LSP, which is known for hogging lots of resources. It seems to have happened at least a couple times when I’m editing a .ts file, so that’s a good theory. Add a swap file The first thing I did was add a swap file so memory can spill over onto disk if necessary. Gemini said to do this with fallocate or dd depending on your filesystem, but after looking into it, I decided to just use dd to be safe. See this Ask Ubuntu thread. Here’s what I did: # create the swap file sudo dd if=/dev/zero of=/var/cache/swapfile bs=1K count=4M # only root should be allowed to read/write the file, since it can hold sensitive data sudo chmod 600 /var/cache/swapfile # format the file as swap sudo mkswap /var/cache/swapfile # activate the swap file sudo swapon /var/cache/swapfile # check the swap status…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.