EC2 Pricing: Understanding Compute Costs on AWS

Amazon EC2 pricing considerations (& how to save your money)

After a first glance at the Amazon EC2 pricing page, you might find absorbing so much information a little intimidating. In this post, we will try to break EC2 pricing down and provide strategies to not only ease the pain but also save your organization money.

First and foremost, you would need to answer the following questions regarding your project:

  1. Will the machine be running 24/7 (a webserver, for example) or will it be temporary (like a Dev/test machine)?
  2. Bandwidth considerations: where will the data be stored?
    1. On Amazon or on-premise (basically anywhere outside Amazon)?
    2. Will the machine be outside-accessible (i.e., Internet-facing) or will it just talk to machines within the cluster (like an SQL Server)?
  3. Is it important for the machine to maintain uninterrupted uptime or is it OK to lose it temporarily (say a data cruncher pulling from a queue)?
  4. Does data need to be stored on the machine?
  5. Do you need additional software on the machine (a prebuilt SQL Server or Red Hat OS)?

With the above answered we can now get down to the nitty-gritty details and start figuring out costs.

Amazon EC2 pricing basically follows the following formula:

EC2 Machine + Block Store + Optional Software + Bandwidth + Optional Services

Amazon EC2 Pricing Tiers

EC2 pricing can now seem pretty straightforward. With information from questions 1&3, you can use the flow chart below to pick the correct tier. First though, a quick overview of tiers:

On-Demand Instance

a Basic type of virtual machine, you pay by the hour, and the machine will stay up as long as the hardware is functioning (i.e., Amazon won’t turn it off)

Reserved Instance

This machine is basically on a contract, so you’re buying it for 12/24/36 months, to run 24/7/365. This can provide significant savings, especially for longer-term contracts

Spot Instances

These instances are much cheaper, sometimes up to 60% below On-demand instance costs. They are purchased by the hour, and as the name suggests on the spot (i.e. at the time you spin up the machine). The downside is they can be brought down by Amazon at any time, with no warning

The EC2 pricing diagram

Block Store Pricing

Block Store Pricing comes into effect when the answer to question four is yes.

There are two types of Amazon EC2 storage: Instance Level storage and EBS.

  1. Instance Level storage is local storage on the machine which disappears when the machine is shut down. Any data on that storage is lost.
  2. EBS storage is persistent, so even when a machine is shut down it stays around and can be attached to another machine.

EC2 pricing for Block Store is charged based on GB per month. There are also High performance and backup options available

EC2 Pricing: optional software

I won’t go too deeply into this topic, as it really deserves its own post. But basically, you can purchase software from the AWS marketplace to run on your machines and pay per hour of use.

Think Oracle, Windows or Red Hat.

Bandwidth

Your answer to question two should help you with this section.

In essence, Intra-AWS transfers within the same availability zone are free (one exception is using a public IP since effectively you are going out to the internet and coming back in).
Internet inbound is free, Internet outbound costs money

Optional Services

Amazon offers services such as Monitoring and Load balancing, which have structures independent of Amazon EC2 pricing and are usually charged hourly in addition to the machine costs.

If you’re interested in learning more about EC2 cost saving, read this post where we show you  three ways to cut your EC2 costs on Amazon Web Services (AWS). 

Cloud Academy