英文:
How can i configure aws sqs to launch a spot ec2 when the queue size is greater than 0
问题
我是新手AWS服务。我正在创建一个视频流平台,所以每当用户上传视频时,从S3事件向SQS添加一条消息,现在我需要在队列大小大于零时启动一个Spot EC2实例。有人可以帮我实现这个吗?
英文:
I am new to aws services . i am creating a video streaming platform so whenever a user uploads a video a message is added to sqs from s3 event now i have to launch a spot ec2 when the queue size is greater than zero . Can anyone help me for implementing this .
答案1
得分: 2
SQS不会启动EC2实例。SQS只是存储消息。您需要配置一个EC2自动扩展组来启动实例。自动扩展组将需要使用CloudWatch指标来确定何时启动实例。您可以为此提供来自您的SQS队列的指标,可能是ApproximateNumberOfMessagesVisible
。
英文:
SQS doesn't launch EC2 instances. SQS just stores messages. You need to configure an EC2 AutoScaling Group to launch the instances. The AutoScaling group will require a CloudWatch metric to use, to determine when it should launch the instances. You would provide a metric from your SQS queue for that, probably ApproximateNumberOfMessagesVisible
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论