DavidO is trying to rebake 45k posts after changing the S3 CDN URL but encounters memory issues. He attempts to create a swapfile on a Digital Ocean Droplet, facing permission and mounting errors. itsbhanusharma clarifies that swap should be created on the host, not inside the container, and warns against blind actions on production systems. pfaffman suggests stopping the container before modifying the swapfile. Canapin shares that increasing swap size helped with rebaking. DavidO acknowledges his difficulty in retaining technical knowledge, and Andrew_Rowe advises documenting processes on Meta for future reference. The rebake eventually completes, though the exact cause remains unclear.
Oddly enough I let the uncooked run again while I was writing all of that up. Left for a long lunch with some friends and came back to it being 100% done. I’m not sure if the swapfile finally started working or if it was just a low use coincidence of timing, but…
This means that you already have a swapfile, it’s called /swapfile, and it’s in use.
If you want to make it bigger, you can stop your container, then unmount it, and then use that dd command to make it bigger, and then the mkswap command.
If someone else reads this, the way that I do it is to grep swap discourse-setup and look at the commands there. It’s a slightly easier version of what to do.
I don’t know about you, but I was repeatedly going out of memory during a long rebake process. Creating a 2 GB swap improved (more posts got rebaked), but still OOM after a while. Increased swap to 4 GB, and was able to rebake all my posts.
I didn’t know anything about swap files besides this guide Create a swapfile for your Linux server, but chatGPT was knowledgeable enough to help me increase my swap without issues.
One issue for me is that I don’t have a good grasp on what needs to be done in which area. Inside or outside the container or inside or outside of the app. I try to keep good notes and have mental shortcuts for the things that I’ll use again. But just when I start to understand it, I’m done with what I need to do and I won’t touch it again for another 6 to 12 to 18 months. Then I have to kind of relearn it.