20083 mar

Advantages of EC2

I have been using Amazon EC2 for a number of months now to host CribQ.

In a few words, EC2 allows you to spawn virtual servers whenever you need them and pay for them by the hour.

I thought it would be helpful to post a list of pros and cons based on my experience.  This is in response to a question about shared hosting, so the response is somewhat in that context.

Pros:

  1. No long term commitment.  You’re paying by the hour.  ($0.10 – $0.4o cents)  Your balance sheet will thank you.
  2. Internal expertise.  As opposed to using a shared host, you will have the internal expertise to set up your system from scratch, whether you choose to start with a LAMP image or a base Linux install.  There are many many free public images that will get you started, and may require little modification to run your application.
  3. Play space.  You can create additional instances of your application for load testing (client and/or server), testing new architectures, rewrites, versions, etc.  I especially like the ability to create load testing clients, something that is very hard to do cheaply any other way.  How else can you pay $1.20 for 3 hours with 4 CPUs and free bandwidth to load test your application.  (Make sure to use the internal IP address to get the free bandwidth.)
  4. Scaling.  You can easily scale vertically (upgrade to a larger 2 or 4 CPU instance) or horizontally (add instances).  Rather than trying to predict your needs, if you understand how to scale on EC2, you can scale as your demand picks up, and even scale dynamically from hour to hour.
  5. You get tons of RAM.  A small instance has 1.7Gb.  A large instance has 7.5Gb.  Compare that to what you get with other virtual hosts.
  6. You can more easily and cheaply leverage S3 for backup, storage, and serving of large files, and even SimpleDB for persistent storage.
  7. They have excellent bandwidth.
  8. Less worry about hardware failure.  Failures do occur, although it should occur less often than a dedicated server, and recovery is much easier.
  9. No CPU throttling or other usage limitations.  At a shared host, it is common practice to kill long running scripts that are using significant CPU.
  10. Dedicated IP address.  It’s yours and yours alone, as long as you keep your instance running.

Cons:

  1. No static IP addresses.  You’ll need to look around and decide on how you want to manage this.  Hopefully Amazon will address this problem soon.  Basically if you change to a new instance, you will probably also get a new IP.
  2. No international presence.  S3 storage can be located in Europe, but everything else is in the US – all in Seattle I think.  If you’re running a site targeted at Hong Kong, EC2 is not your best choice.
  3. Virtualization does have a performance impact.  You are not getting something as fast as the specs would indicate.  The difference depends on what your doing and you’ll have to read around about this.
  4. Lack of “persistent” primary storage.  This is a bit of a red herring, but if you shut your instance down you will lose the main storage where you database most likely resides.  You must explicitly back up your data.  I view this as a positive because it forces you to have a good backup/restore process, and S3 is knocking on your door.   Equate the extremely low chance of instance corruption with primary hard drive failure and you would be in the same situation.
  5. Not the cheapest option.  The price starts at $72/month for a single CPU instance.  Shared hosting can be as low as $6/month.
  6. Lack of support and management tools.   You’re not buying into a full service shared hosting solution with frequently updated install scripts and 24 hour support.

One response to "Advantages of EC2"

  1. Christopher Moore October 2nd, 2013 00:14 am

    Very useful blog on the pro’s and con’s of ec2, getting an insight on what really is the best approach when deciding what kind of server to use.

Leave a Reply