Skip to content

Commit edce42b

Browse files
authored
Merge pull request #32064 from my-git9/patch-16
Update resource-bin-packing.md
2 parents 2623a94 + b6ecca1 commit edce42b

File tree

1 file changed

+42
-33
lines changed

1 file changed

+42
-33
lines changed

content/zh/docs/concepts/scheduling-eviction/resource-bin-packing.md

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ scheduler.
112112
`shape` 用于指定 `RequestedToCapacityRatioPriority` 函数的行为。
113113

114114
```yaml
115-
{"utilization": 0, "score": 0},
116-
{"utilization": 100, "score": 10}
115+
shape:
116+
- utilization: 0
117+
score: 0
118+
- utilization: 100
119+
score: 10
117120
```
118121

119122
<!--
@@ -125,8 +128,11 @@ The above arguments give the node a score of 0 if utilization is 0% and 10 for u
125128
要启用最少请求(least requested)模式,必须按如下方式反转得分值。
126129

127130
```yaml
128-
{"utilization": 0, "score": 10},
129-
{"utilization": 100, "score": 0}
131+
shape:
132+
- utilization: 0
133+
score: 10
134+
- utilization: 100
135+
score: 0
130136
```
131137

132138
<!--
@@ -135,10 +141,11 @@ The above arguments give the node a score of 0 if utilization is 0% and 10 for u
135141
`resources` 是一个可选参数,默认情况下设置为:
136142

137143
``` yaml
138-
"resources": [
139-
{"name": "CPU", "weight": 1},
140-
{"name": "Memory", "weight": 1}
141-
]
144+
resources:
145+
- name: cpu
146+
weight: 1
147+
- name: memory
148+
weight: 1
142149
```
143150

144151
<!--
@@ -147,11 +154,13 @@ It can be used to add extended resources as follows:
147154
它可以用来添加扩展资源,如下所示:
148155

149156
```yaml
150-
"resources": [
151-
{"name": "intel.com/foo", "weight": 5},
152-
{"name": "CPU", "weight": 3},
153-
{"name": "Memory", "weight": 1}
154-
]
157+
resources:
158+
- name: intel.com/foo
159+
weight: 5
160+
- name: cpu
161+
weight: 3
162+
- name: memory
163+
weight: 1
155164
```
156165

157166
<!--
@@ -161,44 +170,44 @@ weight 参数是可选的,如果未指定,则设置为 1。
161170
同时,weight 不能设置为负值。
162171

163172
<!--
164-
### How the RequestedToCapacityRatioResourceAllocation Priority Function Scores Nodes
173+
### Node scoring for capacity allocation
165174

166175
This section is intended for those who want to understand the internal details
167176
of this feature.
168177
Below is an example of how the node score is calculated for a given set of values.
169178
-->
170179

171-
### RequestedToCapacityRatioResourceAllocation 优先级函数如何对节点评分
180+
### 节点容量分配的评分
172181

173182
本节适用于希望了解此功能的内部细节的人员。
174183
以下是如何针对给定的一组值来计算节点得分的示例。
175184

176185
```
177186
请求的资源
178187

179-
intel.com/foo: 2
180-
Memory: 256MB
181-
CPU: 2
188+
intel.com/foo : 2
189+
memory: 256MB
190+
cpu: 2
182191

183192
资源权重
184193

185-
intel.com/foo: 5
186-
Memory: 1
187-
CPU: 3
194+
intel.com/foo : 5
195+
memory: 1
196+
cpu: 3
188197

189198
FunctionShapePoint {{0, 0}, {100, 10}}
190199

191200
节点 Node 1 配置
192201

193202
可用:
194203
intel.com/foo : 4
195-
Memory : 1 GB
196-
CPU: 8
204+
memory : 1 GB
205+
cpu: 8
197206

198207
已用:
199208
intel.com/foo: 1
200-
Memory: 256MB
201-
CPU: 1
209+
memory: 256MB
210+
cpu: 1
202211

203212
节点得分:
204213

@@ -209,13 +218,13 @@ intel.com/foo = resourceScoringFunction((2+1),4)
209218
= rawScoringFunction(75)
210219
= 7
211220

212-
Memory = resourceScoringFunction((256+256),1024)
221+
memory = resourceScoringFunction((256+256),1024)
213222
= (100 -((1024-512)*100/1024))
214223
= 50
215224
= rawScoringFunction(50)
216225
= 5
217226

218-
CPU = resourceScoringFunction((2+1),8)
227+
cpu = resourceScoringFunction((2+1),8)
219228
= (100 -((8-3)*100/8))
220229
= 37.5
221230
= rawScoringFunction(37.5)
@@ -229,13 +238,13 @@ NodeScore = (7 * 5) + (5 * 1) + (3 * 3) / (5 + 1 + 3)
229238

230239
可用:
231240
intel.com/foo: 8
232-
Memory: 1GB
233-
CPU: 8
241+
memory: 1GB
242+
cpu: 8
234243

235244
已用:
236245
intel.com/foo: 2
237-
Memory: 512MB
238-
CPU: 6
246+
memory: 512MB
247+
cpu: 6
239248

240249
节点得分:
241250

@@ -246,13 +255,13 @@ intel.com/foo = resourceScoringFunction((2+2),8)
246255
= rawScoringFunction(50)
247256
= 5
248257

249-
Memory = resourceScoringFunction((256+512),1024)
258+
memory = resourceScoringFunction((256+512),1024)
250259
= (100 -((1024-768)*100/1024))
251260
= 75
252261
= rawScoringFunction(75)
253262
= 7
254263

255-
CPU = resourceScoringFunction((2+6),8)
264+
cpu = resourceScoringFunction((2+6),8)
256265
= (100 -((8-8)*100/8))
257266
= 100
258267
= rawScoringFunction(100)

0 commit comments

Comments
 (0)