简体   繁体   English

具有SQS的AWS自动扩展和CloudWatch

[英]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: 例如:

  • if 30 messages are added to SQS I would like to have one worker, 如果将30条消息添加到SQS,我希望有一名工作人员,
  • if 60 messages are added to SQS I would like to have two workers, 如果将60条消息添加到SQS,我希望有两名工作人员,
  • if 90 messages are added to SQS I would like to have three workers, 如果将90条消息添加到SQS,我希望有三名工作人员,
  • etc. 等等

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.

相关问题 AWS Autoscaling on CloudWatch SQS 指标问题 - AWS Autoscaling on CloudWatch SQS metric problem AWS Cloudwatch - 当我尝试为SQS创建警报时,自动调节组未显示 - AWS Cloudwatch - Autoscaling groups are not showing up when I try to create an alarm for SQS 如何在CloudWatch Schedule + SQS上触发AWS Lambda - How to trigger AWS Lambda on CloudWatch schedule + SQS 没有为SQS指标“ NumberOfMessagesReceived”触发AWS CloudWatch警报 - AWS CloudWatch Alarm not triggered for SQS Metrics “NumberOfMessagesReceived” 适用于SQS的AWS CloudWatch警报消息数量可见 - AWS CloudWatch alarm for SQS Number of Messages Visible 为什么AWS CloudWatch没有Autoscaling组的内存使用率指标 - Why AWS CloudWatch does not have Memory usage metric for Autoscaling group Newrelic:带有AWS Autoscaling Groups响应的Cloudwatch插件是否返回零? - Newrelic: Cloudwatch Plugin with AWS Autoscaling Groups responses being returned nil? AWS ECS - 使用 CloudWatch 警报的自动缩放无法按预期工作 - AWS ECS - autoscaling using CloudWatch alarm does not work as expected 如何在AWS CloudWatch中为AWS SQS添加偶数模式 - How to add Even Pattern for AWS SQS in AWS CloudWatch Cloudwatch警报,可根据条件自动缩放 - Cloudwatch alarm for Autoscaling with condition
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM