不使用时,将EC配置为缩放为零

发布于 2025-01-31 03:24:34 字数 227 浏览 4 评论 0原文

我正在使用Fargate在AWS EC中运行超集。超集的这个实例仅用于内部用途。我希望能够在不使用时配置ECS以扩展到零任务。我知道,恢复需要花费时间(可能是几分钟),此应用程序的最终用户满足于等待几分钟。

情况:

  • AWS ECS使用Fargate Autoscaling设置部署
  • 到最大2,而0分钟为0
  • ,在不使用时要扩展到0(例如,一个小时)

I'm running Superset in AWS ECS using Fargate. This instance of Superset is for internal use only. I want to be able to configure ECS to scale to zero tasks when not in use. I am aware that it will take time (Possibly minutes) to come back up, the end-users of this application are content with waiting a few minutes.

Situation:

  • AWS ECS deployed using Fargate
  • Autoscaling set to a max of 2 and a min of 0
  • Want to scale to 0 when not in use (after, say, an hour)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海里的那抹蓝 2025-02-07 03:24:34

不可能在不使用时将EC降低到零。 ECS的设计目的是连续运行,与随着请求到达时可以打开和关闭的Lambda功能不同。


但是,如果您的内部用户仅在已知时间(例如工作时间)访问该应用程序,则可以在特定时间内使用计划的缩放比例缩放为零。

您可以使用为此。

aws application-autoscaling put-scheduled-action --service-namespace ecs \
    --schedule "cron(15 12 * * ? *)" \ 
    ...

这篇AWS博客文章更详细地解释: https://aws.amazon.com/blogs/containers/optimizing-amazon-elastic-container-service-for-cost-cost-cost-cost-using-scheduled-scaling/

Scaling ECS down to zero when not in use is not possible. ECS is designed to run continuously, unlike Lambda functions that can be turned on and off as requests arrive.


However, if your internal users only access the application during known hours (say business hours), then you can use scheduled scaling to scale to zero during specific hours.

You can use put-scheduled-action for that.

aws application-autoscaling put-scheduled-action --service-namespace ecs \
    --schedule "cron(15 12 * * ? *)" \ 
    ...

This AWS Blog post explains it in more detail: https://aws.amazon.com/blogs/containers/optimizing-amazon-elastic-container-service-for-cost-using-scheduled-scaling/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文