简体   繁体   English

AWS EC2 CloudWatch 指标解释

[英]AWS EC2 CloudWatch metrics interpretation

How should I interpret the AWS EC2 CloudWatch NetworkIn and NetworkOut metrics?我应该如何解释 AWS EC2 CloudWatch NetworkIn 和 NetworkOut 指标?

What does the Statistic: Average in the chart refer to?图表中的Statistic: Average指的是什么?

云观察

The docs state that "the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces”. 文档指出“Amazon EC2 NetworkIn 指标的单位是字节,因为 NetworkIn 跟踪实例在所有网络接口上接收的字节数”。

When viewing the chart below, Network In (Bytes) , with Statistic: Average and a Period: 5 Minutes (note that the time window is zoomed in to around five hours, not one week), it is not immediately obvious how the average is calculated.查看下面的图表Network In (Bytes) ,使用Statistic: Average和一个Period: 5 Minutes (请注意,时间窗口被放大到大约 5 小时,而不是一周),平均值如何并不是很明显计算。 网络平均

Instance i-aaaa1111 (orange) at 15.29: 2664263.8 15.29 的实例 i-aaaa1111(橙色): 2664263.8

If I change Statistic to “Sum”, I get this:如果我将 Statistic 更改为“Sum”,我会得到: 网络总和

The same instance (i-aaaa1111), now at 15.31: 13321319同一个实例 (i-aaaa1111),现在在 15.31: 13321319

It turns out 13321319 /5 = 2664263.8 , suggesting that incoming network traffic during those five minutes was, on average, 2664263.8 Bytes/minute.结果是13321319 /5 = 2664263.8 ,这表明在这五分钟内传入的网络流量平均为 2664263.8 字节/分钟。

=> 2664263.8/60 ≈ 44404.4 Bytes/second => 2664263.8/60 ≈ 44404.4 字节/秒

=> 4404.39/1024 ≈ 43.3KB/s => 4404.39/1024 ≈ 43.3KB/s

=> 43.3*8 ≈ 350Kbps => 43.3*8 ≈ 350Kbps

I tested this by repeatedly copying a large file from one instance to another, transferring at an average speed of 30.1MB/s.我通过将一个大文件从一个实例重复复制到另一个实例来测试这一点,平均传输速度为 30.1MB/s。 The CloudWatch metric was 1916943925 Bytes (Average) => around 30.5MB/s CloudWatch 指标是 1916943925 字节(平均)=> 大约 30.5MB/s

The metric, "Network In (Bytes)", refers to bytes/minute.指标“网络输入(字节)”是指字节/分钟。

It appears in my case that the average is computed over the period specified.在我的情况下,平均值是在指定的时间段内计算的。 In other words: for '15 Minutes', it divides the sum of bytes for the 15-minute period by 15, for '5 Minutes', it divides the sum for the 5-minute period by 5.换句话说:对于“15 分钟”,它将 15 分钟周期的字节总和除以 15,对于“5 分钟”,它将 5 分钟周期的总和除以 5。

Here is why I believe this: I used this chart to debug an upload where rsync was reporting ~710kB/sec (~727,000 bytes / sec) when I expected a faster upload.这就是我相信这一点的原因:我使用此图表来调试上传,其中 rsync 报告了 ~710kB/sec(~727,000 字节 / 秒),而我希望上传速度更快。 After selecting lots of different sum values in the EC2 plot, I determined that the sums were correct numbers of bytes for the period specified (selecting a 15 minute period tripled the sum compared to a 5 minute period).在 EC2 图中选择了许多不同的总和值后,我确定总和是指定时间段内正确的字节数(与 5 分钟时间段相比,选择 15 分钟时间段是总和的三倍)。 Then viewing the average and selecting different periods shows that I get the same value of ~45,000,000 when I select a period of "5 Minutes", "15 Minutes", or "1 Hour".然后查看平均值并选择不同的时间段显示,当我选择“5 分钟”、“15 分钟”或“1 小时”的时间段时,我得到了相同的 ~45,000,000 值。

45,000,000 (bytes/???) / 730,000 (bytes/sec) is approximately 60, so ??? 45,000,000(字节/???)/730,000(字节/秒)大约是 60,所以 ??? is a minute (60 seconds).是一分钟(60 秒)。 In fact, ~45,000,000 / 1024 / 60 = ~730 kB/sec and this is within 3% of what rsync was reporting.事实上,~45,000,000 / 1024 / 60 = ~730 kB/sec,这与 rsync 报告的数据相差不到 3%。

Incidentally, my 'bug' was user error - I had failed to pass the '-z' option to rsync and therefore was not getting the compression boost I expected.顺便说一句,我的“错误”是用户错误 - 我未能将“-z”选项传递给 rsync,因此没有获得我预期的压缩提升。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM