对于作业服务器亚马逊自动缩放API [英] Amazon Auto Scaling API for Job Servers

查看:129
本文介绍了对于作业服务器亚马逊自动缩放API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了pretty的多,整个文档甚至超越对AWS AS API来了解所有的AS的东西。

I have read pretty much the entire documentation even beyond on the AWS AS API to understand all the AS stuff.

不过我还是想知道(无需实际使用的API,但因为我想从别人发现这一点在前)如果我的方案是可行的与AS。

However I am still wondering (without having actually used the API yet since I wanna find this out first from someone) if my scenario is viable with AS.

说我有一堆工作服务器设置中的AS组工作的所有工作每突然说到的时间(我不知道说的,AVG的CPU比还是在另一起案件中小于80%大于)扩大规模或下降。

Say I got a bunch of work servers setup within an AS group all working on a job each and suddenly it comes the time (I dunno say, AVG CPU is greater than or in another case less than 80%) to scale up or down.

我主要担心的是当前正在进行的工作的损失。也许这将更好地用一个例子说明:

My main worry is the loss of a currently in progress job. Maybe this would be better explained with an example:

  • 在我启动与晚五的工作对他们的5作业服务器
  • 在作业结束在一个并触发一个比例放倒触发亚马逊API中
  • 亚马逊来扩展他们失望
  • 在我输了,实际上是当前正在运行的作业作业服务器(再次完成90%得启动)

考虑到这一点是我最好只使用亚马逊现货实例/ EC2 API,只是管理自己的比例还是有我丢失的东西怎么亚马逊API法官服务器端接?

With this in mind is it better for me to just use the Amazon Spot Instance/EC2 API and just manage my own scaling or is there something I am missing about how the Amazon API judges server terminations?

说实话,我宁愿扩展到SQS等待量低于服务器上一些健康图:

To be honest I rather scale to SQS waiting amount than some health figure on the servers:

  • ,每100封邮件等待增加群集容量20%

但是,这似乎并没有太可行与AS无论是。

But this doesn't seem to be too viable with AS either.

那么,AWS的AS API不是正确的解决方法还是我失去了一些关于它是如何工作的重要信息?

So is the AWS AS API not the right solution or am I missing some vital info about how it works?

谢谢

推荐答案

一些搜索,我发现有两个公认的方法来管理AS API或作为一般的职位后:

After some searching I found that there are two accepted ways to manage AS API or AS in general for jobs:

一种方法是直接从工人本身内操纵的服务器的健康。这是相当多的网站做,这是有效的,你的工人没有检测到更多的就业机会或裁员时,它标志着服务器它是不健康的系统。一段时间后,这种方式称为API走来,并自动采取下来。

One method is to manipulate the health of a server directly from within the worker itself. This is what quite a few sites do and it is effective, when your worker detects no more jobs or redundancy in the system it marks the server it is on as unhealthy. This way the AS API comes along and automatically takes it down after a period of time.

所以用这个方法,你就必须根据你的SQS队列大小在一段时间规模达策略(说的SQS消息是在100的每5分钟加2服务器,SQS的消息,每10分钟为超过500个由50%的双网络容量)。按比例缩小将由code,而不是积极的政策来处理。

So with this method you would have a scale up policy based on your SQS queue size over a period of time (say for every 5 mins of SQS messages being over 100 add 2 servers; every 10 mins of SQS messages being over 500 double network capacity by 50%). The scale down would be handled by code instead of an active policy.

此方法将与零集群太多,所以你可以关闭群集一路没有服务器时,它没有被用来制作得相当划算的。

This method would work with zero clusters too so you can down your cluster all the way to no servers when it's not being used making it quite cost effective.

优势:

  • 易于安装
  • 在使用AWS的API函数
  • 在可能的最快设置
  • 在使用AWS托管API来管理群集的大小为你

缺点:

  • 难以管理,而无需使用完整的AWS API即使在一个新的服务器,你不能得到它的INSTANCEID回不拼尽全力instanceids的完整的API命令的回报。还有其他场合AWS AS API获取你的方式,使生活有点困难,如果你想在你的集群的自我控制的元素
  • 在依托亚马逊知道什么是最适合你的钱包。你是依靠亚马逊的API来正确缩放,这是一个优势很多,但一些劣势。
  • 在工作人员必须容纳你的一些服务器池code这意味着工人不是通用的,不能只是瞬间移动到没有一些配置更改另一个集群。

考虑到这一点还有第二种选择,自己动手做。您可以使用EC2现货实例和按需实例的API基于你的自定义规则,以使自己的AS的API。这是pretty的简单解释:

With this in mind there is a second option, DIY. You use the EC2 Spot Instance and on Demand Instance API to make your own AS API based around your custom rules. This is pretty simple to explain:

  • 您有一个命令行脚本,当运行开始时,说,10台服务器
  • 您有一个cronjob,当检测到满足一定的条件下起伏的服务器或UPS多个

优势:

  • 易于清洁管理你的最终
  • 可以使普通的工人
  • 服务器池可以开始管理多个集群
  • 您可以制定规则,哪些不是真的很复杂,从在AWS上的指标得到的数字,并使用他们的比较​​和时间范围来理解,如果事情应该改变。

缺点:

  • 很难得到多地区(不那么糟糕,因为SQS SQS是一个地区)
  • 很难对付的区域的能力和工作量
  • 错误
  • 您必须依靠自己的服务器正常运行时间和您自己的code,保证了运行的cronjob,因为它应该和规定的服务器,因为它应该,打破下来时,它应该。

因此​​,其实这似乎是一场战斗,其中更舒适为最终用户。我个人琢磨两人还是和已经创建了一个小的自托管服务器的缓冲池,可以为我工作,但在同一时间,我很想尝试,并得到这个工作对AWS的自己的API。

So really it seems to be a battle of which is more comfortable for the end user. I personally am mulling the two still and have created a small self hosted server pooler that could work for me but at the same time I am tempted to try and get this to work on AWS' own API.

希望这有助于人,

编辑:注意使用这些方法,你仍然需要在你的身边,以predict一个函数,你应该如何出价,因此你将需要调用出价记录API在您的点型(EC2型)和计算如何出价。

Note with either of these methods you will still require a function on your side to predict how you should bid, as such you will need to call the bid history API on your spot type (EC2 type) and compute how to bid.

另一个编辑:另一种方式来自动检测冗余的系统是检查指标,用来SQS队列空响应。这是时代的工人ping通的队列,没有得到响应的时间。这个,如果你在你的应用程序为职工期间使用的排他锁是相当有效的。

Another Another way to automatically detect redundancy in a system is to check the empty responses metric for your SQS queue. This is the amount of times your workers have pinged the queue and received no response. This is quite effective if you use an exclusive lock in your app for the duration of the worker.

这篇关于对于作业服务器亚马逊自动缩放API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆