Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ec2 spot complete price history

Tags:

amazon-ec2

I am using API to get ec2 spot price history, but I cannot get anything except for last 90 or so days, and cannot specify frequency of observations. Is there a way to get a complete history of spot prices, preferable at minute or hourly frequency?

like image 801
onlyvix.blogspot.com Avatar asked Jan 18 '13 19:01

onlyvix.blogspot.com


People also ask

How often does AWS spot pricing change?

The following table displays the Spot price for each region and instance type (updated every 5 minutes). Spot Instances are available at a discount of up to 90% off compared to On-Demand pricing. To compare the current Spot prices against standard On-Demand rates, visit the Spot Instance Advisor.

How are spot instances charged?

You pay the Spot price that's in effect at the beginning of each instance-hour for your running instance. If Spot price changes after you launch the instance, the new price is charged against the instance usage for the subsequent hour.

What is spot price AWS?

A Spot Instance is an instance that uses spare EC2 capacity that is available for less than the On-Demand price. Because Spot Instances enable you to request unused EC2 instances at steep discounts, you can lower your Amazon EC2 costs significantly. The hourly price for a Spot Instance is called a Spot price.

How long do spot instances last?

You can select from one of two pricing options for spot instances: Regular spot pricing—instances can be terminated with 2 minutes notice. Defined duration—you can get a spot instance guaranteed to run for a period of 1-6 hours. The longer the defined duration, the lower the discount provided for the spot instance.


2 Answers

While not explicitly documented for the DescribeSpotPriceHistory API action, this restriction is at least mentioned for the AWS Management Console (which uses that API in turn), see Viewing Spot Price History:

You can view the Spot Price history over a period from one to 90 days based on the instance type, the operating system you want the instance to run on, the time period, and the Availability Zone in which it will be launched.

  • Since anybody could have retrieved and logged the entire spot price history ever since this API is available (and without a doubt quite some users and researchers have done just that; even the AWS blog listed some dedicated Third-Party AWS Tracking Sites, but these are all defunct at first sight), this restriction admittedly seems a bit arbitrary, but is certainly pragmatic from a strictly operational point of view, i.e. you have all the information you need to base future bids upon (esp. given AWS has only ever reduced prices so far, and regularly does so in fact much to the delight of its customers).

Likewise there's no option to change the frequency, so you'd need to resort to client side code for the hourly aggregation.

like image 107
Steffen Opel Avatar answered Oct 16 '22 13:10

Steffen Opel


This website has re-sampled EC2 spot price histories for some regions, you may access them via a simple API directly from your Python script:

http://ec2-spot-prices.ai-mmo-games.de/

I hope this helps.

like image 26
James Swarowski Avatar answered Oct 16 '22 14:10

James Swarowski