简体   繁体   English

替代AWS上的专色实例的内置自动缩放组

[英]Alternative for built-in autoscaling groups for spot instances on AWS

I am currently using spot instances managed with auto-scaling groups. 我目前正在使用通过自动缩放组管理的现场实例。 However, ASG has a number of shortcomings for use with spot instances. 但是,ASG在使用spot实例时存在许多缺点。 For example, it cannot launch instances of a different instance type if the current type is experiencing a price spike across all availability zones. 例如,如果当前类型的所有可用区域都出现价格飙升,则无法启动其他实例类型的实例。 It can't even re-distribute the number of running instances across zones (if one zone has a price spike, you're down 30% in the number of running instances.) 它甚至无法跨区域重新分配运行实例的数量(如果一个区域出现价格飙升,则运行实例数量下降30%。)

Are there any software solutions that I could run which would replace built-in AWS Auto-Scaling Groups? 是否有任何我可以运行的软件解决方案可以取代内置的AWS Auto-Scaling Groups? I've heard of SpotInst and Batchly, but I do not trust them. 我听说过SpotInst和Batchly,但我不相信它们。 Basically, I think their business plan involves being bought out and killed by Amazon, like what happened to ClusterK. 基本上,我认为他们的商业计划涉及被亚马逊收购和杀害,就像ClusterK所发生的那样。 The evidence for this is the bizarre pricing policies and other red flags. 这方面的证据是奇怪的定价政策和其他危险信号。 I need something that I can self-host and depend on. 我需要一些我可以自我主持和依赖的东西。

AWS recently released Auto Scaling for Spot Fleets which seems to fit your use case pretty well. AWS最近发布了适用于Spot Fleets的Auto Scaling,它似乎非常适合您的用例。 You can define the cluster capacity in terms of vCPU that you need, choose the instance types you'd like to use and their weights and let AWS manage the rest. 您可以根据所需的vCPU定义集群容量,选择您要使用的实例类型及其权重,让AWS管理其余部分。 They will provision spot instances at their current market price up to a limit you can define per instance type (as before), but integrating Auto Scaling capabilities. 他们将以当前市场价格提供现场实例,最高可达每个实例类型(如前所述)的限制,但需要集成Auto Scaling功能。

You can find more information here. 您可以在这里找到更多信息。 https://aws.amazon.com/blogs/aws/new-auto-scaling-for-ec2-spot-fleets/ https://aws.amazon.com/blogs/aws/new-auto-scaling-for-ec2-spot-fleets/

It's unlikely that you're going to find something that takes into account everything you want. 您不太可能找到考虑到您想要的一切的东西。 But because everything in Amazon is an API, so you can write that yourself. 但是因为亚马逊中的所有东西都是API,所以你可以自己写。 There are lots of ways to do that. 有很多方法可以做到这一点。

For example, you could write a small script (bash, ruby, python etc) that shells out the AWS CLI to get the price, then shells out to launch boxes. 例如,您可以编写一个小脚本(bash,ruby,python等),它会弹出AWS CLI以获取价格,然后发送到启动框。 For bonus points, use the native AWS SDK library instead of shelling out. 对于奖励积分,请使用本机AWS SDK库而不是外壳。 (That will be slightly easier to handle errors, etc.) For even more bonus points, open source it, and hope that other people to improve on it! (这将更容易处理错误等)。对于更多的奖励积分,开源它,并希望其他人改进它!

This script can run on your home computer, or on a t1.micro for $5/month. 此脚本可以在您的家用计算机上运行,​​也可以在t1.micro上运行,每月5美元。 Or you could write it in node.js, and run it on Lambda for pennies per month. 或者您可以在node.js中编写它,并在Lambda上运行它以获得每月便士。

Here at Spotinst, these are exactly the problems we built Elastigroup to solve. 在Spotinst,这些正是我们建立Elastigroup要解决的问题。 Elastigroup enables running simultaneously on as many instance types and availability zones (within a region) as you'd like. Elastigroup可以根据您的需要同时在尽可能多的实例类型和可用区域(在一个区域内)运行。 This is coupled with several things to maintain production availability: 这与保持生产可用性的几个因素相结合:

  1. Our algorithm makes live choices for the best Spot markets in terms of price and availability. 我们的算法在价格和可用性方面为最佳现货市场提供实时选择。

  2. When an interruption happens, we predict it about 15 minutes in advance and take all the necessary steps to ensure (and insure) the capacity of your group. 当发生中断时,我们会提前15分钟预测并采取一切必要措施来确保(并确保)您的团队的能力。

  3. In the extreme case that none of the markets have Spot availability, we simply fall back to an on-demand instance. 在极端情况下,没有一个市场有现货可用性,我们只是回到按需实例。

We have a great relationship with AWS and work closely with both their technical and business teams to provide our joined customers with the best experience possible. 我们与AWS建立了良好的合作关系,并与其技术和业务团队密切合作,为我们的加入客户提供最佳体验。 As we manage resources inside your own AWS account, I wouldn't put the relationship between us as a concern, to begin with. 当我们管理您自己的AWS账户内的资源时,我不会将我们之间的关系作为一个关注点开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM