主导资源计算器基于主导资源公平(DRF)的概念。
要了解DRF,你可以参考这里的纸:https://people.eecs.berkeley.edu/~alig/papers/drf.pdf
本文,请参阅第4.1节,在这里给出一个例子。
DRF尝试平衡主导份额(A的内存需求= B的CPU需求)。
说明
Total Resouces Available
:100个CPU,10000 GB存储器
Requirements of Application A
:2个CPU,300 GB存储器
Requirements of Application B
:6级的CPU,100 GB存储器
A's dominant resource is Memory
(2 %的CPU与3%的内存)
B's dominant resource is CPU
(CPU的6%和存储器的1%)
让我们假设 “A” 被分配x
容器和 “B” 被分配y
容器。
的B的
2x CPUs + 300x GB Memory (2 CPUs and 300 GB Memory for each container)
所需资源所需资源:
6y CPUs + 100y GB Memory (6 CPUs and 100 GB Memory for each container)
总的要求是:
2x + 6y <= 100 CPUs
300x + 100y <= 10000 GB Memory
DRF将尝试平衡A和B的主导需求。
A's dominant need: 300x/10000 GB (300x out of 10000 GB of total memory)
B's dominant need: 6y/100 CPUs (6y out of 100 CPUs)
DRF will try to equalise: (300x/10000) = (6y/100)
Solving the above equation gives: x = 2y
如果替代x = 2y
和解决在步骤3中的等式,将得到X = 20和y = 10。
这意味着:
Application A is allocated 20 containers: (40 CPUs, 6000 GB of Memory)
Application B is allocated 10 containers: (60 CPUs, 1000 GB of memoty)
可以看到:提供
Total allocated Memory is:
Total allocated CPU is:
40 + 60 = < 100个CPU 6000 + 1000 < = 10000 GB的可用内存
因此,上述方案说明了句子的含义:
Since B’s container requests are twice as big in the dominant resource (6%
versus 3%), it will be allocated half as many containers under fair sharing.
大和精确的解释,现在我已经明白了!我认为我错过的关键概念是每个需求都是指一个容器。我稍后会阅读PDF文件。非常感谢你! – tsuda7
非常好的解释。感谢您的链接。 –