Wednesday, November 14, 2012

Paying for your Amazon EC2 Micro Instance

I signed up for Amazon Cloud Free Tier Micro Php MySQL and loved it, but now my year is up and it's time to pay. I'm about halfway through my first paid month and it's looking like $15/month.

This Month's Activity as of November 14, 2012 

US East (Northern Virginia) Region
  Amazon EC2 running Linux/UNIX
    $0.020 per Micro Instance (t1.micro) instance-hour (or partial hour)   332 Hrs   $6.64
  Amazon EC2 EBS
    $0.10 per GB-month of provisioned storage                          3.678 GB-Mo   $0.37
    $0.10 per 1 million I/O requests                                   218,548 IOs   $0.02
  Amazon CloudWatch
    $0.00 per alarm-month - first 10 alarms                            0.461 Alarms  $0.00

So almost all the cost is the hours of instance. Looking at Amazon EC2 Pricing, we can do better. You can reserve an instance (enter a contract and pay some up-front) to reduce your overall cost. They have Light, Medium, and Heavy Utilization Reserved Instances. This refers to the hours online, not CPU, etc.

Light:  8760 hrs/yr * 0.012 $/hr = $105.12 + $23 (1yr term) = $128.12
Medium: 8760 hrs/yr * 0.007 $/hr =  $61.32 + $54 (1yr term) = $115.32
Heavy:  8760 hrs/yr * 0.005 $/hr =  $43.80 + $62 (1yr term) = $105.80

Light:  8760 hrs/yr * 0.012 $/hr = $105.12 +  $35/3 (3yr term) = $116.79
Medium: 8760 hrs/yr * 0.007 $/hr =  $61.32 +  $82/3 (3yr term) = $88.65
Heavy:  8760 hrs/yr * 0.005 $/hr =  $43.80 + $100/3 (3yr term) = $77.13

So if you're running an always-on web server then the Heavy Utilizaton price is best for you, and locking in for a 3yr term only saves you $23/yr, but I don't want to deal with it yearly, so I'm locking in for a 3yr term.

Reserved instances are just an accounting mechanism. You pay the fee then from whatever you have currently running, if any map to what you have reserved (same type, same availability zone) then those running instances are billed at the cheaper rate.

AWS > EC2 > Reserved Instances [sidebar] > Purchase Reserved Instances
 Platform:         Linux/UNIX
 Instance Type:    t1.micro
 Availabilty Zone: us-east-1b
 Term:             2 years - 3 years
 Tenancy:          Default
 Offering Type:    Heavy Utilization
 > Search > Quantity: 1 > Add to Cart > View Cart > Purchase > Close

After your purchase, the type, term, start-date, hourly-fee, etc will appear on: EC2 > Reserved Instances. The state is initially payment-pending.

aws
{ "loggedin": false, "owner": false, "avatar": "", "render": "nothing", "trackingID": "UA-36983794-1", "description": "", "page": { "blogIds": [ 283 ] }, "domain": "holtstrom.com", "base": "\/michael", "url": "https:\/\/holtstrom.com\/michael\/", "frameworkFiles": "https:\/\/holtstrom.com\/michael\/_framework\/_files.4\/", "commonFiles": "https:\/\/holtstrom.com\/michael\/_common\/_files.3\/", "mediaFiles": "https:\/\/holtstrom.com\/michael\/media\/_files.3\/", "tmdbUrl": "http:\/\/www.themoviedb.org\/", "tmdbPoster": "http:\/\/image.tmdb.org\/t\/p\/w342" }