如何在 Elastic Beanstalk 中为 Auto Scaling EC2 实例配置触发器?
我想在 Elastic Beanstalk 中配置 Auto Scaling 的触发器。
基本上,如果用户超过 4 秒没有得到响应,我想扩展新实例。
您能告诉我如何实现这一目标吗?
I would like to configure triggers for Auto Scaling in Elastic Beanstalk.
Basically I want to scale-out new instance if the user does not get response for more than 4 seconds.
Can you please advise how can I achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Elastic Beanstalk 中,您可以设置触发器,如果用户在指定时间内未收到响应,则触发器将启动新实例。在 Elastic Beanstalk 中配置环境时,您可以设置 EC2 实例运行状况检查并配置运行状况检查间隔和运行状况检查超时。如果服务器在运行状况检查间隔内没有响应,Auto Scaling 将启动新实例。
有关更多详细信息: http://docs .amazonwebservices.com/elasticbeanstalk/latest/ug/index.html?using-features.managing.elb.html
In Elastic Beanstalk, you can set triggers which will start new instances, if users don't get responses in the specified time. While configuring your environment in Elastic Beanstalk, you can setup an EC2 instance health check and configure the health check interval and health check timeout. If the server doesn't respond within the health check interval, Auto Scaling will bring up new instances.
For more details: http://docs.amazonwebservices.com/elasticbeanstalk/latest/ug/index.html?using-features.managing.elb.html
AWS EB 有一个针对延迟等的特定扩展指标,这就是您希望在您的案例中使用的指标。正如 SanketDangi 提到的,健康检查很重要,但需要明确的是,它不会自动“启动新实例”。它肯定会使失败的实例停止服务。至于这是否会启动扩展操作,取决于自动扩展策略,例如 EB 在创建新的 EB 应用程序时为您设置的配置的最小实例数。
AWS EB has a specific scaling metric for latency, amongst others, which is what you'd want to use in your case. The health check is important as SanketDangi mentioned, but to be clear it won't automatically "bring up new instances". It WILL for sure take that failed instance out of service. As to whether this kicks off a scaling operation, that depends on the auto scaling policies, like the configured Min Instances for example that EB sets up for you when creating a new EB app.