ECS Fargate 自动扩展速度更快?

2023-12-25

我正在对我的自动扩展 AWS ECS Fargate 堆栈进行负载测试,其中包括:

  • 目标组指向 ECS 的应用程序负载均衡器 (ALB),
  • ECS 集群、服务、任务、ApplicationAutoScaling::ScalableTarget 和 ApplicationAutoScaling::ScalingPolicy、
  • the application auto scaling policy defines a target tracking policy:
    • 类型:目标跟踪缩放,
    • 预定义指标类型:ALBRequestCountPerTarget,
    • 阈值 = 1000 个请求
    • 当过去 1 分钟评估期内 1 个数据点超出阈值时,将触发警报。

这一切都很好。警报确实被触发,并且我看到正在发生横向扩展操作。但检测“阈值突破”的速度感觉很慢。这是我的负载测试和 AWS 事件的时间安排(从 JMeter 日志和 AWS 控制台的不同位置整理而来):

10:44:32 start load test (this is the first request timestamp entry in JMeter logs)
10:44:36 4 seconds later (in the the JMeter logs), we see that the load test reaches it's 1000th request to the ALB. At this point in time, we're above the threshold and waiting for AWS to detect that...
10:46:10 1m34s later, I can finally see the spike show up in alarm graph on the cloudwatch alarm detail page BUT the alarm is still in OK state!
    NOTE: notice the 1m34s delay in detecting the spike, if it gets a datapoint every 60 seconds, it should be MAX 60 seconds before it detects it: my load test blasts out 1000 request every 4 seconds!!
10:46:50 the alarm finally goes from OK to ALARM state
    NOTE: at this point, we're 2m14s past the moment when requests started pounding the server at a rate of 1000 requests every 6 seconds!
    NOTE: 3 seconds later, after the alarm finally went off, the "scale out" action gets called (awesome, that part is quick):
14:46:53 Action Successfully executed action    arn:aws:autoscaling:us-east-1:MYACCOUNTID:scalingPolicy:51f0a780-28d5-4005-9681-84244912954d:resource/ecs/service/my-ecs-cluster/my-service:policyName/alb-requests-per-target-per-minute:createdBy/ffacb0ac-2456-4751-b9c0-b909c66e9868
After that, I follow the actions in the ECS "events tab":
10:46:53 Message: Successfully set desired count to 6. Waiting for change to be fulfilled by ecs. Cause: monitor alarm TargetTracking-service/my-ecs-cluster-cce/my-service-AlarmHigh-fae560cc-e2ee-4c6b-8551-9129d3b5a6d3 in state ALARM triggered policy alb-requests-per-target-per-minute
10:47:08 service my-service has started 5 tasks: task 7e9612fa981c4936bd0f33c52cbded72 task e6cd126f265842c1b35c0186c8f9b9a6 task ba4ffa97ceeb49e29780f25fe6c87640 task 36f9689711254f0e9d933890a06a9f45 task f5dd3dad76924f9f8f68e0d725a770c0.
10:47:41 service my-service registered 3 targets in target-group my-tg
10:47:52 service my-service registered 2 targets in target-group my-tg
10:49:05 service my-service has reached a steady state.
    NOTE: starting the tasks took 33 seconds, this is very acceptable because I set the HealthCheckGracePeriodSeconds to 30 seconds and health check interval is 30 seconds as well)
    NOTE: 3m09s between the time the load starting pounding the server and the time the first new ECS tasks are up
    NOTE: most of this time (3m09s) is due to the waiting for the alarm to go off (2m20s)!! The rest is normal: waiting for the new tasks to start. 

Q1:有没有办法让警报触发得更快和/或一旦超过阈值就触发?对我来说,这花费了 1 分 20 秒太多了。它实际上应该在 1 米 30 秒左右扩展(最多 1 米检测警报高状态 + 30 秒启动任务)...

注意:我在今天打开的另一个问题中记录了我的 CloudFormation 堆栈:Cloudformation ECS Fargate 自动缩放目标跟踪:1 分钟内 1 个自定义警报:无法执行操作 https://stackoverflow.com/questions/67335419/cloudformation-ecs-fargate-autoscaling-target-tracking-1-custom-alarm-in-1-minu


你对此无能为力。 ALB 将指标发送到 CloudWatch间隔 1 分钟 https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html。这些指标也是不是实时的无论如何,因此预计会有延迟,甚至长达几分钟,正如 AWS 支持所解释的和评论中报告的那样here https://stackoverflow.com/a/64045238/248823:

指标会出现一些延迟,这是任何监控系统所固有的,因为它们取决于多个变量,例如发布指标的服务的延迟、CloudWatch 中的传播延迟和摄取延迟等。我确实明白,一致的延迟 3 或 4 分钟ALB 指标偏高。

您要么必须过度配置 ECS,以在警报触发和扩展执行时维持增加的负载,要么降低阈值。

或者,您可以创建自己的自定义指标 https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html,例如从您的应用程序。这些指标可以以 1 秒为间隔。您的应用程序还可以“手动”触发警报。这将使您减少观察到的延迟。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ECS Fargate 自动扩展速度更快? 的相关文章

  • 多个对象以某种方式相互干扰[原始版本]

    我有一个神经网络 NN 当应用于单个数据集时 它可以完美地工作 但是 如果我想在一组数据上运行神经网络 然后创建一个新的神经网络实例以在不同的数据集 甚至再次同一组数据 上运行 那么新实例将产生完全错误的预测 例如 对 XOR 模式进行训练
  • 如何让JComboBox中的内容居中显示?

    目前我有这个JComboBox 我怎样才能将其中的内容居中 String strs new String 15158133110 15158133124 15158133458 JComboBox com new JComboBox str
  • 使用ssl和socket的python客户端身份验证

    我有一个 python 服务器 需要客户端使用证书进行身份验证 我如何制作一个客户端脚本 使用客户端证书由 python 中的服务器使用 ssl 和套接字模块进行身份验证 有没有仅使用套接字和 ssl 而不扭曲的示例 from OpenSS
  • Android Jasper 报告

    Jasper Reporting 可以集成到 Android 应用程序中吗 我正在尝试从 jrxml 文件生成 PDF CSV 文本和 XLS 报告 但是 我没有看到 Android SDK 支持 net sf jasperreports
  • 查找总和为给定数字的值组合的函数

    这个帖子查找提供的 Sum 值的组合 https stackoverflow com a 20194023 1561176呈现函数subsets with sum 它在数组中查找总和等于给定值的值的组合 但由于这个帖子已经有6年多了 我发这
  • Bootstrap 3 / 显示模式不适用于 javascript 方式

    我用Modal http getbootstrap com javascript modalsBootstrap 3 0 的功能 我有这个代码 a href myNestedContent Open the modal containing
  • 如何为不同操作系统/Python 版本编译 Python C/C++ 扩展?

    我注意到一些成熟的Python库已经为大多数架构 Win32 Win amd64 MacOS 和Python版本提供了预编译版本 针对不同环境交叉编译扩展的标准方法是什么 葡萄酒 虚拟机 众包 我们使用虚拟机和Hudson http hud
  • 在 VS2008 的 XAML 编辑器中禁用 Intellisense?

    有没有办法在 Visual Studio 2008 的 XAML 编辑器中禁用 Intellisense 打字时通常会消耗很大的性能 有时我会等待十秒或更长时间 直到列表自动弹出 似乎在 选项 gt 文本编辑器 gt XAML 中 Inte
  • Swing:创建可拖动组件...?

    我在网上搜索了可拖动 Swing 组件的示例 但我发现示例不完整或不起作用 我需要的是一个摇摆组件那可以是dragged通过鼠标 在另一个组件内 被拖拽的时候 应该已经 改变它的位置 而不仅仅是 跳 到目的地 我很欣赏无需非标准 API 即
  • 如何检查设备上是否安装了文本转语音 (TTS) 的特定语言数据?

    我正在创建一个使用文本转语音的应用程序 我希望用户能够离线使用它 因此我检查设备上是否安装了 TTS 数据 以下是执行此操作的代码 Check tts data is installed Intent checkTTSIntent new
  • C++ Boost ASIO 简单的周期性定时器?

    我想要一个非常简单的周期性计时器每 50 毫秒调用我的代码 我可以创建一个始终休眠 50 毫秒的线程 但这很痛苦 我可以开始研究用于制作计时器的 Linux API 但它不可移植 I d like使用升压 我只是不确定这是否可能 boost
  • ggplot2 的 fortify 函数出错

    我在 ggplot2 中使用 fortify 方法时收到此错误 Error in function classes fdef mtable unable to find an inherited method for function pr
  • 在门户中查看 Azure WebJob 计划?

    我创建了一个简单的 Azure WebJob 并通过 Visual Studio 集成制定了每天运行一次的计划 我已经部署了 WebJob 并看到它列在我在 Azure 上的应用程序中 schema http schemastore org
  • Apache Beam Pipeline 写表后查询表

    我有一个 Apache Beam Dataflow 管道 它将结果写入 BigQuery 表 然后我想查询该表以获取管道的单独部分 但是 我似乎无法弄清楚如何正确设置此管道依赖性 我编写的新表 然后想要查询 与一个单独的表连接以进行某些过滤
  • 以 Rails 形式处理 MongoMapper EmbeddedDocument

    首先 我对一般编程和 Rails 都是新手 我选择 Rails 是因为它看起来是一种很容易上手的语言 对于我的项目 我将 MongoMapper 与 Rails 结合使用 我正在尝试以与文档相同的形式处理嵌入文档 我有以下模型 class
  • 在 for 循环比较中使用集合大小

    Java 中 Collections 的 size 方法是否有编译器优化 考虑以下代码 for int i 0 i
  • 根据列中的部分字符串匹配选择数据框行

    我想根据列中字符串的部分匹配从数据框中选择行 例如列 x 包含字符串 hsa 使用sqldf if它有一个like语法 我会做类似的事情 select from lt gt where x like hsa 很遗憾 sqldf不支持该语法
  • 给定文档,选择相关片段

    当我在这里提出问题时 自动搜索返回的问题的工具提示给出了问题的前一点 但其中相当一部分没有给出任何比理解问题更有用的文本 标题 有谁知道如何制作一个过滤器来删除问题中无用的部分 我的第一个想法是修剪仅包含某个列表中的单词的任何前导句子 例如
  • 从 npm 脚本运行时,eslint 不会报告任何错误

    我已经使用 npm init eslint config 安装了带有 typescript 的 eslint 然后将 lint 脚本添加到我的 package json 中 但是当我运行 npm script lint npm run li
  • 无法将 /root/.rnd 加载到 RNG 中

    我想使用 Windows Open SSL 生成服务器证书 当我运行此命令行时 出现此错误 我应该怎么办 Command openssl req new x509 days 3650 key ca key out ca crt Error

随机推荐