从URL https://developer.ibm.com/hadoop/2017/06/30/deep-dive-yarn-cgroups/中我们看到了以下纱线cgroup的CPU限制公式,我的问题是,如果有很多线程(假设500个线程,每个线程都执行CPU密集型操作,例如无限循环操作),这些公式仍然有效)在每个容器中运行?就是说,如果线程数远大于每个容器的vcore数,yarn cgroup是否仍可以控制CPU使用率?
"In hard limit mode, YARN uses the following formula to calculate the CPU limit for each container.
C: number of physical CPU cores
P: strict limit percent
V: number of vcores on a single node manager
A: number of vcores for a single container
CPU_LIMIT = C * P * A / V;
In our example, a single container requests one vcore. The CPU limit for this container will be
CPU_LIMIT = C * P * A / V = 8 * 50% * 1 / 6 = 2/3 = 66.7%
And if there is another container requesting 2 vcores, the CPU limit for that container will be
CPU_LIMIT = C * P * A / V = 8 * 50% * 2 / 6 = 4/3 = 133%"