amazon-web-services - ECS部署及匹配运行任务数
问题描述
场景:ECS Fargate。
假设我有 2 个任务的“期望计数”。
系统承担一些负载并自动扩展到 6 个任务。
如果我在这段时间部署,ECS 似乎会将我的实际运行能力降低到 2 个任务。这会导致服务失败,因为系统无法再处理实际负载,现在必须扩大规模。我遇到的所有文档都表明使用“最小健康百分比”和“最大百分比”来帮助控制部署规模,但这些都是指返回的任务数量,而不是实际部署到的实际系统上运行的实际数量。
知道是否有办法说:“请匹配正在运行的任务数量,或者在从部署中启动新任务时匹配其中的某个百分比”?
通过 CodePipeline 部署是 Cloudformation。
解决方案
CFN 中的DesiredCount
参数现在是可选的。有关背景,请参阅此问题。
从问题:
We are making following improvements to ECS integration with Cloudformation:
- DesiredCount becomes an optional field in CFN CreateService and DesiredCount=1 would be used as the default value if it is missing
- UpdateService will also omit DesiredCount when it is missing in CFN template
Customers expect the current behavior (i.e. UpdateService will use the set DesiredCount in the CFN template) can just add DesiredCount in their CFN templates. Existing customers wanting the new behavior can get it by removing DesiredCount from their CFN templates. The changes will be released soon.
推荐阅读
- c# - 如何让主窗体监听控件中的按钮单击
- html - Blazor 服务器端未加载事件侦听器
- python - 使用python将图像和文本写入文件
- c# - 从 WebService 发出异步请求
- reactjs - 将数据传递给事件处理程序的更好方法是:通过函数闭包或自定义数据属性
- python - 如何在 Python 中打开 MHTML 文件?
- r - 有两个书目时,CSL 文件不适用于所有地方
- c# - 传递字符串参数时,“S”附近的语法不正确
- javascript - 如何在使用 json 加载网站期间通过捕获字段名称和 url 来屏蔽数据
- jquery - Ajax 在 Django 中只运行一次