How to configure swap for your EC2 instance

Swap

Every time I fire up a new EC2 instance, I inevitably forget to configure swap memory for it (why don’t they just come pre-configured?) only to realize it later when some application experiences sudden death at the hands of a (shriek!) OutOfMemoryError. I’ve gotten pretty quick at configuring this, and thought I’d share the recipe.

The following instructions are for an EC2 instance running Amazon Linux (which is basically CentOS). They will probably work for any RedHat-based distro.

Read More