[英]AWS Autoscaling and CloudWatch with SQS
I have an application that performs long running tasks. 我有一个执行长时间运行任务的应用程序。 So it decided to use AWS SQS with Autoscaling policy and CloudWatch. 因此,它决定将AWS SQS与Autoscaling策略和CloudWatch一起使用。
I read that Amazon SQS queues sends metrics to CloudWatch every five minutes. 我读到Amazon SQS队列每五分钟将指标发送到CloudWatch。 I known that my single task takes 10 seconds. 我知道我的单个任务需要10秒。 So one worker can handle 30 tasks for five minutes. 因此,一个工人可以在五分钟内完成30项任务。 I would like that message will live as short as possible in SQS. 我希望该消息在SQS中尽可能短。 For example: 例如:
According to documentation I created a AutoScaling policy (that adds 1 instance) and CloudWatch alarm (that fires this policy if there is more than 30 ApproximateNumberOfMessagesVisible). 根据文档,我创建了一个AutoScaling策略(添加了1个实例)和CloudWatch警报(如果存在30个以上的NumberNumberOfMessagesVisible,则将触发此策略)。 So should I add a second ClouldWatch alarm if there are more than 60 messages? 因此,如果消息多于60条,我是否应该添加第二个ClouldWatch警报? And third ClouldWatch alarm if there are more than 90 messages? 第三次ClouldWatch警报是否有超过90条消息?
否。您的政策将继续重复添加计算机,直到指标降至30以下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.