2016-09-06 82 views
4

我在读“的Hadoop权威指南”第4版的,和整个这个解释成纱DRF进来(第4章,优势资源公平)说明纱线的DRF

试想总集群100个CPU和10 TB内存。应用程序A请求容器(2个CPU,300 GB),应用程序B请求容器(6个CPU,100 GB)。 A的请求是集群的(2%,3%),所以内存占主导地位,因为它的比例(3%)大于CPU(2%)。 B的请求是(6%,1%),所以CPU占主导地位。由于B的容器需求量占统治地位资源的两倍(6%与3%),所以在公平分享的情况下,容器的容量将被分配一半。

我不明白it will be allocated half as many containers under fair sharing的含义。我猜it这里是Application BApplication B被分配了应用程序A容器数量的一半。这样对吗?为什么Application B即使需要更多资源也会分配更小的容器?

任何建议和指示某些解释文件将不胜感激。先谢谢你。

回答

8

主导资源计算器基于主导资源公平(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容器。

  1. 的B的

    2x CPUs + 300x GB Memory (2 CPUs and 300 GB Memory for each container) 
    
  2. 所需资源所需资源:

    6y CPUs + 100y GB Memory (6 CPUs and 100 GB Memory for each container) 
    
  3. 总的要求是:

    2x + 6y <= 100 CPUs 
    
    300x + 100y <= 10000 GB Memory 
    
  4. 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. 
+0

大和精确的解释,现在我已经明白了!我认为我错过的关键概念是每个需求都是指一个容器。我稍后会阅读PDF文件。非常感谢你! – tsuda7

+0

非常好的解释。感谢您的链接。 –