VCores-Total: Indicates the total number of VCores available in the cluster
Memory-Total: Indicates the total memory available in the cluster.
例如我有一个单节点集群,其中,我将每个容器的内存要求设置为:1228 MB(由配置确定:yarn.scheduler.minimum-allocation-mb)和每个容器的 vCore 为 1 个 vCore(由配置确定:yarn.scheduler.minimum-allocation-vcores)。
我已将:yarn.nodemanager.resource.memory-mb 设置为 9830 MB。因此,每个节点总共可以有 8 个容器 (9830 / 1228 = 8)。
所以,对于我的集群:
VCores-Total = 1 (node) * 8 (containers) * 1 (vCore per container) = 8
Memory-Total = 1 (node) * 8 (containers) * 1228 MB (memory per container) = 9824 MB = 9.59375 GB = 9.6 GB
下图显示了我的集群指标:
现在让我们看看 "MB-seconds" 和 "vcore-seconds"。
根据代码中的描述(ApplicationResourceUsageReport.java):
MB-秒:应用程序分配的内存总量(以兆字节为单位)乘以应用程序运行的秒数。
vcore-seconds:应用程序分配的 vcore 总数乘以应用程序运行的秒数。
描述不言自明(记住关键字:聚合)。
让我用一个例子来解释一下。
我运行了一个 DistCp 作业(生成了 25 个容器),为此我得到了以下结果:
Aggregate Resource Allocation: 10361661 MB-seconds, 8424 vcore-seconds
现在,让我们粗略计算一下每个容器花费了多少时间:
For memory:
10361661 MB-seconds = 10361661 / 25 (containers) / 1228 MB (memory per container) = 337.51 seconds = 5.62 minutes
For CPU
8424 vcore-seconds = 8424 / 25 (containers) / 1 (vCore per container) = 336.96 seconds = 5.616 minutes
这表明平均每个容器需要 5.62 分钟来执行。
我希望这能说明问题。您可以执行作业并自行确认。