【问题标题】:AWS spot instance pricing bid valueAWS 现货实例定价投标值
【发布时间】:2018-09-26 12:32:04
【问题描述】:

鉴于网页上的定价为:每小时 0.0663 美元,因此我尝试以每小时 0.03 美元的最大单位对 c5.xlarge 实例进行竞标,因此这将略低于一半。

然而,它在仪表板上显示:

Status

price-too-low: Your Spot request price of 0.03 is lower than the 
minimum required Spot request fulfillment price of 0.097. 

广告价格怎么可能是 0.0663,当我要求 0.03 时,它告诉我最低是 0.097?

【问题讨论】:

  • 您使用的是哪个地区?
  • @kirrmann eu-central-1

标签: amazon-ec2


【解决方案1】:

https://forums.aws.amazon.com/thread.jspa?threadID=137848

“价格过低”的出价状态也会向您显示市场价格 在评估您的出价时。您的出价未完成,因为它 低于现货市场价格。让您的出价成功 履行您将不得不出价高于市场价格。如果你出价 更低,您的出价只有在市场跌至下方时才会被执行 您稍后的出价。

因此,0.097 似乎是当前市场价格,而 0.0663 是 c5.xlarge 的默认/最小值

【讨论】:

  • 默认/最小是什么意思?市场价格图表显示 0.0663 是当前市场价格。
【解决方案2】:

Spot 定价将根据该区域的可用容量而波动,并且是按实例类型和每个可用区而定。 https://aws.amazon.com/ec2/spot/pricing/ 上的价格是区域价格的指示。为了更接近您提议的实际价格,您可以考虑使用 API 查看可用区域。

最近现货定价发生了变化,旨在平衡定价变化:https://aws.amazon.com/blogs/compute/new-amazon-ec2-spot-pricing/

有一次在 ap-south-east-2 中,我们有一个 m4.large 可用区的价格翻了三倍,而其他区则保持历史正常价格。作为故障排除的一部分,我编写了以下简单的 Python 脚本,可以帮助您了解您所在地区的当前价格:

#!/usr/bin/python
import boto3
from datetime import datetime, timedelta
from dateutil import tz

ec2 = boto3.client('ec2')

from_zone = tz.tzutc()
to_zone = tz.tzlocal()

print "Local Time:", str(datetime.now())
print "UTC Time  :", str(datetime.utcnow())

endTime = datetime.utcnow().replace(tzinfo=from_zone)
startTime = endTime-timedelta(hours=1)

def outputSpotPricing(az):
    response = ec2.describe_spot_price_history(
        AvailabilityZone=az,
        EndTime=endTime,
        InstanceTypes=[
            'm4.large',
            'm4.xlarge',
        ],
        ProductDescriptions=[
            'Linux/UNIX (Amazon VPC)',
        ],
        StartTime=startTime,
        MaxResults=3
    )

    print "\n---------AvailabilityZone", az
    for price in response['SpotPriceHistory']:
        print "Price:", price['SpotPrice']
        print "Time :", str( price['Timestamp'].astimezone(to_zone))

outputSpotPricing('ap-southeast-2a')
outputSpotPricing('ap-southeast-2b')
outputSpotPricing('ap-southeast-2c')
print ''

【讨论】:

    猜你喜欢
    • 2019-12-01
    • 1970-01-01
    • 2022-01-06
    • 1970-01-01
    • 1970-01-01
    • 2020-05-24
    • 1970-01-01
    • 2016-09-25
    • 2015-05-18
    相关资源
    最近更新 更多