noahgibbs / madscience

Obsolete: deploy your Rails app with a full dedicated server in an hour! The source for Ruby Mad Science and Rails Deploy In An Hour (Note: link is now to a different project!)
http://rubymadscience.com
MIT License
67 stars 2 forks source link

Mount swap file during Chef deployment #1

Closed noahgibbs closed 7 years ago

noahgibbs commented 9 years ago

With Chef and everything running, it takes more than 1GB to compile modern Ruby. That's fine in Vagrant - we default to 2GB of RAM. It's fine on larger real instances.

However, it's not fine for the free tier of Amazon or the cheap tier of DO/Linode. Which means we want to mount around 1GB of swap file during server provisioning and then unmount and delete afterward.

Quick docs on how to do that in current Linux: http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/