网络数据输出 - nmon/nload 与 AWS Cloudwatch 差异

Network data out - nmon/nload vs AWS Cloudwatch disparity

我们是 运行 EC2 实例中的视频会议服务器。

由于这是一个数据输出(出口)繁重的应用程序,我们希望密切监视网络数据输出(因为我们为此收取了高额费用)。

如上图所示,在我们的测试中,在我们的 EC2 中使用 nmon(右上)或 nload(左)服务器在 nload 中将网络显示为 138 Mbits/s ,在 nmon 中显示为 17263 KB/s 非常接近(138/ 8 = 17.25).

但是,当我们在 AWS Cloudwatch(右下角)中检查网络(字节)时,显示的数字非常高 (~ 1 GB/s)(这对我们的测试更有意义运行),这就是我们最终收费的数字。

为什么 nmon/nload 和 AWS Cloudwatch 有这么大的区别? 我们在这里缺少一些理解吗?我们没有正确查看 AWS Cloudwatch 指标吗?

感谢您的帮助!

编辑:

添加更长测试的屏幕截图,该屏幕截图显示 AWS Cloudwatch 中的平均网络输出指标在测试持续时间内保持在 1 GB 左右,而 nmon 显示平均网络输出为 15816 KB/s。

来自AWS docs

NetworkOut: The number of bytes sent out by the instance on all network interfaces. This metric identifies the volume of outgoing network traffic from a single instance. The number reported is the number of bytes sent during the period. If you are using basic (five-minute) monitoring, you can divide this number by 300 to find Bytes/second. If you have detailed (one-minute) monitoring, divide it by 60.

您的NetworkOut图表并不代表当前速度,它代表最近5分钟内所有网络接口发出的字节数。如果我的计算是正确的,我们应该得到以下值:

1.01 GB ~= 1027 MB (reading from your graph)

To get the average speed for the last 5 minutes:

1027 MB / 300 = 3.42333 MB/s ~= 27.38 Mbits/s

虽然这只是最后 5 分钟的平均值,但仍然超出您的预期。

刚找到答案。

下面link说说AWS的数据抓包周期: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html

Periods

A period is the length of time associated with a specific Amazon CloudWatch statistic. Each statistic represents an aggregation of the metrics data collected for a specified period of time. Periods are defined in numbers of seconds, and valid values for period are 1, 5, 10, 30, or any multiple of 60. For example, to specify a period of six minutes, use 360 as the period value. You can adjust how the data is aggregated by varying the length of the period. A period can be as short as one second or as long as one day (86,400 seconds). The default value is 60 seconds.

Only custom metrics that you define with a storage resolution of 1 second support sub-minute periods. Even though the option to set a period below 60 is always available in the console, you should select a period that aligns to how the metric is stored. For more information about metrics that support sub-minute periods, see High-resolution metrics.


如上文 link 所示,如果我们不设置具有自定义周期的自定义指标,AWS 默认情况下不会捕获亚分钟数据。因此,可用数据的最低分辨率是每 1 分钟一次。

因此,在我们的例子中,60 秒内的网络输出数据被聚合并捕获为单个数据点。

即使我将统计数据更改为平均并将周期更改为1秒,它仍然显示每1分钟的数据。

现在,如果我将 1.01 GB(由 AWS 显示)除以 60,我得到的每秒数据大约为 16.8 MBps,这非常接近 nmon 或 nload 显示的数据。