Solving Amazon EC2 Memory Issues

Wed, Apr 30, 2014

Often with the Amazon micro instances, and other instances with low memory allocations, your web server will ‘crash’, especially where MySQL’s involved. After a few page requests the MySQL engine can lock up because it doesn’t have enough memory.

Amazons micro instances don’t come with any swap memory by default so if you experience issues and don’t want the costs of bumping your server to the next instance size, adding some swap space can improve performance of the micro instances no end:

Then hit enter. This says ‘write and quit’ which is essentially save and exit the editor.

After each reboot your server will now start Apache, MySQL and swap memory.

Depending on what you’re running you may still have memory issues but keep in mind that the Amazon micro instances only have just over half a gig of memory so it may be that your application is just too resource heavy to run on the free tier.