Listing Recent Prices for EC2 Spot Instances

| 11 Comments | 0 TrackBacks | Bookmark and Share

The new spot instances on EC2 are a great way to get some extra compute power at a price you can live with, especially if you are flexible on exactly when the instances run. On the other hand maybe you won’t get the compute power if the spot instance price never drops to the max price you are willing to pay.

The best way to approach auction type situations like this is often to simply list the maximum price you can afford. Your instance(s) will get run if and when the spot instance price reaches that price and you will regularly get charged less depending on what other users are bidding for their instances.

Though I don’t recommend trying to chase the spot instance price around, it is natural to be curious about what others have been paying and whether or not you might have a chance to get in with your bid.

The ec2-describe-spot-price-history command lists the historical values of the spot instance price for all sizes and types of instances. This is useful for studying fluctuations over time, but sometimes you’ll just want to know what the latest spot instance price is, even though this is not necessarily the price you would get charged if you opened new spot instance requests.

The following command shows the most recent spot instance price for each size of the Linux instances:

ec2-describe-spot-price-history -d Linux/UNIX |
  sort -rk3 |
  perl -ane 'print "$F[1]\t$F[3]\n" unless $seen{$F[3]}++' |
  sort -n

To check the spot price in a different region, simply add an option like

--region us-west-1

or

--region eu-west-1

As of the writing of this article, the prices returned for the us-east-1 region are as follows:

0.026   m1.small
0.05    c1.medium
0.11    m1.large
0.25    c1.xlarge
0.265   m1.xlarge
0.443   m2.2xlarge
0.997   m2.4xlarge

The exact spot instance prices will vary significantly from these samples over time and likely even during the course of a day. In fact, the spot instance price may occasionally exceed the on demand (standard) EC2 instance price.

Who’s going to be the first person to provide handy, real time, spot price history graphs by EC2 region, instance class (Linux/Windows), and instance type with correct X-axis date/time scaling?

Good luck bidding!

No TrackBacks

TrackBack URL: http://alestic.com/mt/mt-tb.cgi/61

11 Comments

i have plotted the spot price for an m1.small instance over the last two weeks:

http://www.flickr.com/photos/tlossen/4185350530/

Eric, what would stop someone from bidding $0.09 (or similar) for an instance they hope remains ON? Can I associate an elastic IP etc.?

your wish is my command ;)

--> http://www.cloudexchange.org

(updated every 5 minutes)

danhixon: I'm not sure I understand the question. If you want an instance which remains on, just start a normal on-demand instance and leave it running.

You can't associate an elastic IP address with a spot instance request, but after the spot instance starts, it could automatically associate an elastic IP address with itself if you configure it to do so.

Tim: Nice! Here are some more requests:

1. Instead of drawing a diagonal line between price points, show each price as a horizontal line until a new price change comes in to play.

2. Always show the current date/time at the right edge of the chart so that we can see graphically how long the current price has been active.

right ... much better now. :)

I put "DIY Amazon EC2 Spot Instances price chart " - http://bit.ly/8ws8vt short tutorial linking back to your article. Let me know if you find it useful.

We also have some statistics on EC2 at TheCloudMarket
http://thecloudmarket.com/stats

TheCloudMarket.com has created a spot price chart which includes the ability to compare price history across different types and regions:

http://thecloudmarket.com/stats#/spot_prices

[Update: Heh, I noticed this feature and posted the comment before I noticed Philip's blog comment in the approval queue.]

You can also get a graphical view of the latest spot prices in the AWS Management Console... handy...

Leave a comment

Stay Updated

Subscribe with email address:
 Subscribe with a reader
Join the EC2 Ubuntu Google Group
Follow Eric Hammond on Twitter

More Entries

Move a Running EBS Boot Instance to New Hardware on Amazon EC2
Amazon EC2 has been experiencing some power issues in a portion of one of their many data centers. Even though…
One Weekend to Prototype CrowdPhoto.net using AWS Technologies
On Friday evening (2 days ago) I and a number of other high octane LA individuals came to LA StartupWeekend…
Ubuntu AMIs available for Amazon EC2 in Asia Pacific (Singapore)
Amazon EC2 just launched the Asia Pacific region with data centers in Singapore. The standard Ubuntu and Debian AMIs (Amazon…
Ubuntu 10.04 Lucid Released for Amazon EC2
Ubuntu 10.04 Lucid was released on Amazon EC2 right on schedule today along with the rest of the normal Ubuntu…
Upgrading Servers to Ubuntu 10.04 Lucid on Amazon EC2
Ubuntu 10.04 Lucid is expected to be released this Thursday (April 29, 2010). This is the first LTS (long term…
Identifying When a New EBS Volume Has Completed Initialization From an EBS Snapshot
On Amazon EC2, you can create a new EBS volume from an EBS snapshot using a command like ec2-create-volume --availability-zone…
New releases of Ubuntu and Debian Images for Amazon EC2 (20100319)
Note: I do not recommend that new users start with these AMIs. These AMIs run with older versions of Amazon’s…
SCALE 8x Talk Notes: EC2 Beginners Workshop
At SCALE 8x (Southern California Linux Expo, Feb 2010) I did a walkthrough demonstrating how to use the AWS console…
The BitSource Interview of Eric Hammond (SCALE, EC2)
Matthew Sacks, of The BitSource, made the mistake of asking me some questions about Amazon EC2, so I rambled on…
Resizing the Root Disk on a Running EBS Boot EC2 Instance
In a previous article I described how to run an EBS boot AMI with a larger root disk size than…
New Ubuntu 8.04.3 Hardy AMIs for Amazon EC2
Scott Moser (Canonical) built and released new Ubuntu 8.04.3 LTS Hardy images and AMIs for Amazon EC2. I also published…
Southern California Linux Expo - Februrary 19-21, 2010 at the Westin LAX
The 8th Southern California Linux Expo (aka SCaLE 8x) is a community organized, non-profit event. Those words and the…
Public EBS Boot AMIs for Ubuntu on Amazon EC2
If you’ve been following along, you probably know that I have been recommending that folks using EC2 switch to the…
How to Report Bugs with Ubuntu on Amazon EC2: ubuntu-bug
The official Ubuntu AMIs published by Canonical for EC2 starting in October have proven to be solid and production worthy.…
Three Ways to Protect EC2 Instances from Accidental Termination and Loss of Data
Here are a few little-publicized benefits that were launched with Amazon EC2’s new EBS boot instances: You can lock them…
Building EBS Boot AMIs Using Canonical's Downloadable EC2 Images
In the last article, I described how to use the vmbuilder software to build an EBS boot AMI from scratch…
Building EBS Boot and S3 Based AMIs for EC2 with Ubuntu vmbuilder
Here’s my current recipe for how to build an Ubuntu 9.10 Karmic AMI, either the new EBS boot or the…
Call for testers (building EBS boot AMIs with Ubuntu vmbuilder)
I’m polishing up an article about how to build images from scratch with Ubuntu vmbuilder, both for S3 based AMIs…
ec2-consistent-snapshot release 0.1-9
Thanks to everybody who submitted bug reports and feature requests for ec2-consistent-snapshot, software which can be used to create consistent…
Listing Recent Prices for EC2 Spot Instances
The new spot instances on EC2 are a great way to get some extra compute power at a price you…