ty your article at http://steinn.org/post/elasticbeanstalk-swap/ was helpful.
i found it more useful to setup the swap before everything takes place.
so i setup the swap logic to run as part of the Elastic Beanstalk hooks flow:
you might find it useful as well, enjoy and thanks for the article again!
@samzilverberg thank you to the comment, it helped me a lot, also thanks to steinnes :)
As a suggestion, you can also setup a "post hook" to turn of the swap and remove the swap file, after the deploy:
Wow, I just noticed these comments on my gist, I'm flattered! Perhaps I should enable comments on my blog :-)
@samzilverberg: The reason I chose container_commands was to be able to include the swap setup script as a separate file, but your implementation of inlining inside the config yaml works fine as well, and I guess some will feel that it's more elegant (also it does not suffer from a mistake I made in cleaning up the path). I am curious how you learned to write files into
@lucasdavila: Out of curiosity, why would you disable the swap after the deployment? To me the only upside would be to save some disk space, but offset that against performing extra swap-creation work with every deployment (thus making them slower). If you're worried about the kernel using the swap space and the node performance deteriorating due to unnecessary swapping, that should be avoidable by setting
I'm (perhaps sadly) not going to update the blog post because I've switched to kubernetes for my app deployments, and thus can't easily test your methods, but I did update the gist to remove the erroneous