Amazon Elastic Compute Cloud
User Guide (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Viewing Spot Price History

The Spot price represents the price above which you have to bid to guarantee that a single Spot request is fulfilled. When your bid is above the Spot price, your Spot Instance is launched, and if the Spot price rises above your bid price, your Spot Instance is terminated. You might choose to bid above the current Spot price so that your Spot request is fulfilled quickly. However, before specifying a price with which you want to bid for your Spot Instance, we recommend that you view the Spot price history. You can view the Spot price history for the last 90 days for any pool of Spot Instances sharing the same instance type, operating system, and Availability Zone.

For example, let's say you want to bid on a Linux/UNIX t1.micro instance to be launched in the us-east-1 region. To view past prices in this Spot pool, specify these values using the Spot Price History page of the AWS Management Console, the DescribeSpotPriceHistory API action, or ec2-describe-spot-price-history CLI command. If you need to launch your Spot Instance in a specific Availability Zone, you can specify that Availability Zone when retrieving the Spot price history.

After you review the Spot price history, you might choose to bid at a price that would have given you 75 percent Spot Instance uptime in the past. Or, you might choose to bid two times the current Spot price because doing so would have given you 99 percent uptime in the past. However you frame your bid, keep in mind that past performance of Spot prices is not a guarantee of future results. Spot prices vary based on real-time supply and demand conditions, and the conditions that generated certain Spot prices or pricing patterns in the past may not repeat themselves in the future.

Note

Make sure you have set up the prerequisites for working with Amazon EC2. If you haven't, see Prerequisites for Using Spot Instances.

If you are using an API version earlier than 2011-05-15, the DescribeSpotPriceHistory action or the ec2-describe-spot-price-history command will return the lowest price across the region for the given time period and the prices will be returned in chronological order.

AWS Management Console

To view Spot Price history

  1. From the Amazon EC2 console, click Spot Requests in the navigation pane.

    The Spot Requests pane opens on the right. It will list your Spot requests if you have any.

  2. At the top of the pane, click the Pricing History button.

    The console displays the Spot Instance Pricing History page.

  3. If you want to view the Spot price history for specific Availability Zones, click the Zone drop-down list and select an Availability Zone.

    The Spot Instance Pricing History page displays the Spot Instance pricing history for all zones or the zone you selected.

    Spot Instance Pricing History Displays the pricing history for a specified Availability Zone.
  4. Using the price history as a guide, select a price that you think would likely keep your instances running for the period of time you need.

Command Line Tools

To view Spot price history

  1. Enter the following command:

    PROMPT> ec2-describe-spot-price-history -H --instance-type m1.xlarge

    Amazon EC2 returns output similar to the following:

    SPOTINSTANCEPRICE   0.384000    2011-05-25T11:37:48-0800    m1.xlarge   Windows us-east-1b
    SPOTINSTANCEPRICE   0.384000    2011-05-25T11:37:48-0800    m1.xlarge   Windows us-east-1d
    …
    SPOTINSTANCEPRICE   0.242000    2011-04-18T14:39:14-0800    m1.xlarge   SUSE Linux  us-east-1d
    SPOTINSTANCEPRICE   0.242000    2011-04-18T14:39:14-0800    m1.xlarge   SUSE Linux  us-east-1a

    In this example, the price for the m1.xlarge instance type ranges between $0.242 and $0.384.

  2. Using the price history as a guide, select a price that you think would likely keep your instances running for the period of time that you need.

Tip

You can filter the Spot history data so it includes only instance types or dates of interest to you. For more information about how to filter the results, go to ec2-describe-spot-price-history in the Amazon Elastic Compute Cloud Command Line Reference.

API

To view Spot price history

  1. Construct the following Query request.

    https://ec2.amazonaws.com/
    ?Action=DescribeSpotPriceHistory
    &InstanceType=instance_type
    &...auth parameters...

    Following is an example response.

    <DescribeSpotPriceHistoryResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
        <spotPriceHistorySet>
          <item>
            <instanceType>m1.small</instanceType>
            <productDescription>Linux/UNIX</productDescription>
            <spotPrice>.28</spotPrice>
            <timestamp>2009-12-01T11:51:50.000Z</timestamp>
            <availabilityZone>us-east-1a</availabilityZone>
          </item>
          <item>
            <instanceType>m1.small</instanceType>
            <productDescription>Linux/UNIX</productDescription>
            <spotPrice>.28</spotPrice>
            <timestamp>2009-12-01T11:51:50.000Z</timestamp>
            <availabilityZone>us-east-1a</availabilityZone>
          </item>
          <item>
            <instanceType>m1.small</instanceType>
            <productDescription>Linux/UNIX</productDescription>
            <spotPrice>.31</spotPrice>
            <timestamp>2009-12-01T11:51:50.000Z</timestamp>
            <availabilityZone>us-east-1b</availabilityZone>
          </item>
          <item>
            <instanceType>m1.small</instanceType>
            <productDescription>Linux/UNIX</productDescription>
            <spotPrice>.30</spotPrice>
            <timestamp>2009-12-01T11:51:50.000Z</timestamp>
            <availabilityZone>us-east-1b</availabilityZone>
          </item>
          <item>
            <instanceType>m1.small</instanceType>
            <productDescription>Linux/UNIX</productDescription>
            <spotPrice>.25</spotPrice>
            <timestamp>2009-12-01T11:51:50.000Z</timestamp>
            <availabilityZone>us-east-1c</availabilityZone>
          </item>
          <item>
            <instanceType>m1.small</instanceType>
            <productDescription>Linux/UNIX</productDescription>
            <spotPrice>.28</spotPrice>
            <timestamp>2009-12-01T11:51:50.000Z</timestamp>
            <availabilityZone>us-east-1c</availabilityZone>
          </item>
          <item>
            <instanceType>m1.small</instanceType>
            <productDescription>Linux/UNIX</productDescription>
            <spotPrice>.35</spotPrice>
            <timestamp>2009-12-01T11:51:50.000Z</timestamp>
            <availabilityZone>us-east-1c</availabilityZone>
          </item>
        </spotPriceHistorySet>
        <nextToken/>
    </DescribeSpotPriceHistoryResponse>
  2. Using the price history as a guide, select a price that you think would likely keep your instances running for the period of time you need.

Tip

You can filter the Spot history data so it includes only instance types or dates of interest to you. For more information about how to filter the results, go to DescribeSpotPriceHistory in the Amazon Elastic Compute Cloud API Reference.

What do you want to do next?