Merge pull request #32064 from my-git9/patch-16
Update resource-bin-packing.md
This commit is contained in:
@@ -112,8 +112,11 @@ scheduler.
|
|||||||
`shape` 用于指定 `RequestedToCapacityRatioPriority` 函数的行为。
|
`shape` 用于指定 `RequestedToCapacityRatioPriority` 函数的行为。
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
{"utilization": 0, "score": 0},
|
shape:
|
||||||
{"utilization": 100, "score": 10}
|
- utilization: 0
|
||||||
|
score: 0
|
||||||
|
- utilization: 100
|
||||||
|
score: 10
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -125,8 +128,11 @@ The above arguments give the node a score of 0 if utilization is 0% and 10 for u
|
|||||||
要启用最少请求(least requested)模式,必须按如下方式反转得分值。
|
要启用最少请求(least requested)模式,必须按如下方式反转得分值。
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
{"utilization": 0, "score": 10},
|
shape:
|
||||||
{"utilization": 100, "score": 0}
|
- utilization: 0
|
||||||
|
score: 10
|
||||||
|
- utilization: 100
|
||||||
|
score: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -135,10 +141,11 @@ The above arguments give the node a score of 0 if utilization is 0% and 10 for u
|
|||||||
`resources` 是一个可选参数,默认情况下设置为:
|
`resources` 是一个可选参数,默认情况下设置为:
|
||||||
|
|
||||||
``` yaml
|
``` yaml
|
||||||
"resources": [
|
resources:
|
||||||
{"name": "CPU", "weight": 1},
|
- name: cpu
|
||||||
{"name": "Memory", "weight": 1}
|
weight: 1
|
||||||
]
|
- name: memory
|
||||||
|
weight: 1
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -147,11 +154,13 @@ It can be used to add extended resources as follows:
|
|||||||
它可以用来添加扩展资源,如下所示:
|
它可以用来添加扩展资源,如下所示:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
"resources": [
|
resources:
|
||||||
{"name": "intel.com/foo", "weight": 5},
|
- name: intel.com/foo
|
||||||
{"name": "CPU", "weight": 3},
|
weight: 5
|
||||||
{"name": "Memory", "weight": 1}
|
- name: cpu
|
||||||
]
|
weight: 3
|
||||||
|
- name: memory
|
||||||
|
weight: 1
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -161,14 +170,14 @@ weight 参数是可选的,如果未指定,则设置为 1。
|
|||||||
同时,weight 不能设置为负值。
|
同时,weight 不能设置为负值。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### How the RequestedToCapacityRatioResourceAllocation Priority Function Scores Nodes
|
### Node scoring for capacity allocation
|
||||||
|
|
||||||
This section is intended for those who want to understand the internal details
|
This section is intended for those who want to understand the internal details
|
||||||
of this feature.
|
of this feature.
|
||||||
Below is an example of how the node score is calculated for a given set of values.
|
Below is an example of how the node score is calculated for a given set of values.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### RequestedToCapacityRatioResourceAllocation 优先级函数如何对节点评分
|
### 节点容量分配的评分
|
||||||
|
|
||||||
本节适用于希望了解此功能的内部细节的人员。
|
本节适用于希望了解此功能的内部细节的人员。
|
||||||
以下是如何针对给定的一组值来计算节点得分的示例。
|
以下是如何针对给定的一组值来计算节点得分的示例。
|
||||||
@@ -176,15 +185,15 @@ Below is an example of how the node score is calculated for a given set of value
|
|||||||
```
|
```
|
||||||
请求的资源
|
请求的资源
|
||||||
|
|
||||||
intel.com/foo: 2
|
intel.com/foo : 2
|
||||||
Memory: 256MB
|
memory: 256MB
|
||||||
CPU: 2
|
cpu: 2
|
||||||
|
|
||||||
资源权重
|
资源权重
|
||||||
|
|
||||||
intel.com/foo: 5
|
intel.com/foo : 5
|
||||||
Memory: 1
|
memory: 1
|
||||||
CPU: 3
|
cpu: 3
|
||||||
|
|
||||||
FunctionShapePoint {{0, 0}, {100, 10}}
|
FunctionShapePoint {{0, 0}, {100, 10}}
|
||||||
|
|
||||||
@@ -192,13 +201,13 @@ FunctionShapePoint {{0, 0}, {100, 10}}
|
|||||||
|
|
||||||
可用:
|
可用:
|
||||||
intel.com/foo : 4
|
intel.com/foo : 4
|
||||||
Memory : 1 GB
|
memory : 1 GB
|
||||||
CPU: 8
|
cpu: 8
|
||||||
|
|
||||||
已用:
|
已用:
|
||||||
intel.com/foo: 1
|
intel.com/foo: 1
|
||||||
Memory: 256MB
|
memory: 256MB
|
||||||
CPU: 1
|
cpu: 1
|
||||||
|
|
||||||
节点得分:
|
节点得分:
|
||||||
|
|
||||||
@@ -209,13 +218,13 @@ intel.com/foo = resourceScoringFunction((2+1),4)
|
|||||||
= rawScoringFunction(75)
|
= rawScoringFunction(75)
|
||||||
= 7
|
= 7
|
||||||
|
|
||||||
Memory = resourceScoringFunction((256+256),1024)
|
memory = resourceScoringFunction((256+256),1024)
|
||||||
= (100 -((1024-512)*100/1024))
|
= (100 -((1024-512)*100/1024))
|
||||||
= 50
|
= 50
|
||||||
= rawScoringFunction(50)
|
= rawScoringFunction(50)
|
||||||
= 5
|
= 5
|
||||||
|
|
||||||
CPU = resourceScoringFunction((2+1),8)
|
cpu = resourceScoringFunction((2+1),8)
|
||||||
= (100 -((8-3)*100/8))
|
= (100 -((8-3)*100/8))
|
||||||
= 37.5
|
= 37.5
|
||||||
= rawScoringFunction(37.5)
|
= rawScoringFunction(37.5)
|
||||||
@@ -229,13 +238,13 @@ NodeScore = (7 * 5) + (5 * 1) + (3 * 3) / (5 + 1 + 3)
|
|||||||
|
|
||||||
可用:
|
可用:
|
||||||
intel.com/foo: 8
|
intel.com/foo: 8
|
||||||
Memory: 1GB
|
memory: 1GB
|
||||||
CPU: 8
|
cpu: 8
|
||||||
|
|
||||||
已用:
|
已用:
|
||||||
intel.com/foo: 2
|
intel.com/foo: 2
|
||||||
Memory: 512MB
|
memory: 512MB
|
||||||
CPU: 6
|
cpu: 6
|
||||||
|
|
||||||
节点得分:
|
节点得分:
|
||||||
|
|
||||||
@@ -246,13 +255,13 @@ intel.com/foo = resourceScoringFunction((2+2),8)
|
|||||||
= rawScoringFunction(50)
|
= rawScoringFunction(50)
|
||||||
= 5
|
= 5
|
||||||
|
|
||||||
Memory = resourceScoringFunction((256+512),1024)
|
memory = resourceScoringFunction((256+512),1024)
|
||||||
= (100 -((1024-768)*100/1024))
|
= (100 -((1024-768)*100/1024))
|
||||||
= 75
|
= 75
|
||||||
= rawScoringFunction(75)
|
= rawScoringFunction(75)
|
||||||
= 7
|
= 7
|
||||||
|
|
||||||
CPU = resourceScoringFunction((2+6),8)
|
cpu = resourceScoringFunction((2+6),8)
|
||||||
= (100 -((8-8)*100/8))
|
= (100 -((8-8)*100/8))
|
||||||
= 100
|
= 100
|
||||||
= rawScoringFunction(100)
|
= rawScoringFunction(100)
|
||||||
|
|||||||
Reference in New Issue
Block a user