gpt4 book ai didi

amazon-ec2 - Autoscaling 组无法分配 Spot 实例

转载 作者:行者123 更新时间:2023-12-05 08:51:40 24 4
gpt4 key购买 nike

我有一个 eks 集群,其节点组基于具有以下配置的混合实例分发启动模板:

region: us-west-2  
instance_distribution: [p2.xlarge, p3.2xlarge, p2.8xlarge]
max_price: 0.9
on_demand_percentage_above_base_capacity: 0
on_demand_base_capacity: 0
spot_instance_pools: 2

当希望将自动缩放从 0 扩展到 1 时,集群自动缩放器遇到了以下问题:

Launching a new EC2 instance. Status Reason: Could not launch Spot Instances. SpotMaxPriceTooLow - Your Spot request price of 0.9 is lower than the minimum required Spot request fulfillment price of 0.918. Launching EC2 instance failed. 
At the time, the spot price of p3.2xlarge happened to be 0.918.

似乎请求的是现货 p3.2xlarge,而不是请求 p2.xlarge 的按需实例(即使 p2.xlarge 的按需价格 0.9 低于现货p3.2xlarge 的价格为 0.918)。我希望分配一个按需 p2.xlarge 实例,而不是请求一个 p3.2xlarge spot 实例。是不是因为我配置了on_demand_percentage_above_base_capacity: 0

更一般地说,我希望能够配置集群以获取 p2.xlarge 的 spot 实例,并在不可能时按需请求。实现所需功能的最佳配置是什么?

on_demand_percentage_above_base_capacity的配置是否严格执行?如果 on_demand_percentage_above_base_capacity 设置为 1 并且我的第一个实例是按需实例,我接下来的几个扩展请求是否会被迫只产生 spot 实例或者它更像是一个带有指导方针的权重(例如,如果没有可用的 spot 它仍然会回退到按需而不是未能满足请求)?

最佳答案

长话短说当没有可用点时,AutoScaling 不会故障转移到按需,但它会尝试将点容量故障转移到其他点实例类型和可用性区域

I expected an on-demand p2.xlarge instance to be allocated up instead of requesting a p3.2xlarge spot instance. Is it because I configured on_demand_percentage_above_base_capacity: 0?

您是对的,当您将两个按需设置都设置为 0 时,AutoScaling Group (ASG) 将永远不会尝试启动按需实例。使用混合实例策略时,ASG 将首先确定要启动的 spot 实例与 OnDemand 实例的数量,然后再做出任何其他决定。有关其工作原理的一些详细示例,请参阅 AWS 文档。 https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html#asg-instances-distribution

More generally, I want to be able to configure the cluster to get spot instances of p2.xlarge and when not possible, request for on-demand. What is the best configuration to achieve my desired functionality?

ASG 无法做到这一点。如果您将 ASG 配置为仅启动 spot 实例,它不会故障转移到 ondemand。同样,如果您将其设置为启动 50% 的点播,50% 的点播,如果没有点播,它仍然不会故障转移到点播。它只会启动按需一半,然后继续尝试启动现货一半。防止容量问题发生的最佳方法是:1) 启用更多实例类型和可用性区域(因为每个区域每个实例类型都有不同的容量池)2) 不要设置最高现货价格。现货价格永远不会超过按需价格。您可能还想查看新功能,您可以在其中为您选择的实例类型添加权重: https://aws.amazon.com/about-aws/whats-new/2019/11/amazon-ec2-auto-scaling-supports-instance-weighting/

Is the configuration of on_demand_percentage_above_base_capacity strictly enforced?

If on_demand_percentage_above_base_capacity is set to 1 and my first instance is an on-demand instance, will my next few scaling requests be forced to yield spot instances only

假设您设置 on_demand_base_capacity: 0如果将 percent_above_base 设置为 1,ASG 将创建第一个按需实例(ASG 总是向上取整以达到更多按需实例),接下来的 99 个实例将是 spot,接着是 1 个按需实例,等等。它不会故障转移到 on没有现货产能时的需求

关于amazon-ec2 - Autoscaling 组无法分配 Spot 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59075864/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com