AWS Auto Scaling 组 - 每个目标的应用程序负载均衡器请求计数
AWS Auto Scaling Group - Application Load Balancer Request Count Per Target
在 AWS 上,您可以创建基于 "Application Load Balancer Request Count Per Target" 扩展的自动扩展策略。
像这样:
这最少有 1 个实例,最多有 5 个实例。它的目标应该是为我的 ElbTargetGroup 实现 10 "Request count per target"。
我的问题是,什么是"Application Load Balancer Request Count Per Target"?
这是:
- 负载均衡器到目标的活动连接数除以目标数?
- 每 5 分钟的请求数除以目标数?
- 每 1 分钟的请求数除以目标数?
文档 here 只是说:
The average number of requests received by each target in a target group. You must specify the target group using the TargetGroup dimension.
此外,超过该目标需要多长时间才能开始创建新实例?我问的主要原因是我已经向这个负载均衡器发送了很多请求,但是没有触发缩放事件。
答案是你的第一选择:
“负载均衡器到目标的活动连接数除以目标数”
ELB 指标都是 1 分钟,正如上面 Hagen 引用的那样。
您可以在 AWS ALB doc.
中查看负载均衡器的所有指标定义
注意,有 RequestCount
和 RequestCountPerTarget
,后者是前者除以活动目标的数量。
您可以在 CloudWatch 控制台中查看这两个指标,但在 EC2 控制台中更简单。 Select 左窗格中的目标组,然后是监视选项卡。 (请注意,目标组的监控选项卡与负载均衡器屏幕中的监控有很多重叠)
虽然负载均衡器指标是每 1 分钟一次,但如果您使用 EC2 指标(如 CPU),默认情况下它们只会每 5 分钟一次,除非您 change your CloudWatch settings 打开详细监控以获取每分钟的指标。您需要为详细指标支付额外费用。
RequestCountPerTarget
是负载均衡器指标。 ELB 指标始终超过 1 分钟,如 documentation:
中所述
Elastic Load Balancing reports metrics to CloudWatch only when
requests are flowing through the load balancer. If there are requests
flowing through the load balancer, Elastic Load Balancing measures and
sends its metrics in 60-second intervals. If there are no requests
flowing through the load balancer or no data for a metric, the metric
is not reported.
因此,如果您坚持使用此指标,则无需为详细的 EC2 实例指标付费。这仅在您需要对实例使用 CPU 之类的东西时才有意义。
在 AWS 上,您可以创建基于 "Application Load Balancer Request Count Per Target" 扩展的自动扩展策略。
像这样:
这最少有 1 个实例,最多有 5 个实例。它的目标应该是为我的 ElbTargetGroup 实现 10 "Request count per target"。
我的问题是,什么是"Application Load Balancer Request Count Per Target"?
这是:
- 负载均衡器到目标的活动连接数除以目标数?
- 每 5 分钟的请求数除以目标数?
- 每 1 分钟的请求数除以目标数?
文档 here 只是说:
The average number of requests received by each target in a target group. You must specify the target group using the TargetGroup dimension.
此外,超过该目标需要多长时间才能开始创建新实例?我问的主要原因是我已经向这个负载均衡器发送了很多请求,但是没有触发缩放事件。
答案是你的第一选择: “负载均衡器到目标的活动连接数除以目标数” ELB 指标都是 1 分钟,正如上面 Hagen 引用的那样。
您可以在 AWS ALB doc.
中查看负载均衡器的所有指标定义注意,有 RequestCount
和 RequestCountPerTarget
,后者是前者除以活动目标的数量。
您可以在 CloudWatch 控制台中查看这两个指标,但在 EC2 控制台中更简单。 Select 左窗格中的目标组,然后是监视选项卡。 (请注意,目标组的监控选项卡与负载均衡器屏幕中的监控有很多重叠)
虽然负载均衡器指标是每 1 分钟一次,但如果您使用 EC2 指标(如 CPU),默认情况下它们只会每 5 分钟一次,除非您 change your CloudWatch settings 打开详细监控以获取每分钟的指标。您需要为详细指标支付额外费用。
RequestCountPerTarget
是负载均衡器指标。 ELB 指标始终超过 1 分钟,如 documentation:
Elastic Load Balancing reports metrics to CloudWatch only when requests are flowing through the load balancer. If there are requests flowing through the load balancer, Elastic Load Balancing measures and sends its metrics in 60-second intervals. If there are no requests flowing through the load balancer or no data for a metric, the metric is not reported.
因此,如果您坚持使用此指标,则无需为详细的 EC2 实例指标付费。这仅在您需要对实例使用 CPU 之类的东西时才有意义。