Skip to content

Commit d44eaa4

Browse files
author
zhenghao.zhu
committed
[zh] resync page flow-control
1 parent c6ff7b4 commit d44eaa4

File tree

1 file changed

+67
-76
lines changed

1 file changed

+67
-76
lines changed

content/zh-cn/docs/concepts/cluster-administration/flow-control.md

Lines changed: 67 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ APF 适用于 **watch** 请求。当 APF 被禁用时,**watch** 请求不受 `
8181

8282
<!--
8383
The API Priority and Fairness feature is controlled by a feature gate
84-
and is enabled by default. See
85-
[Feature Gates](/docs/reference/command-line-tools-reference/feature-gates/)
84+
and is enabled by default. See [Feature
85+
Gates](/docs/reference/command-line-tools-reference/feature-gates/)
8686
for a general explanation of feature gates and how to enable and
8787
disable them. The name of the feature gate for APF is
8888
"APIPriorityAndFairness". This feature also involves an {{<
@@ -187,30 +187,29 @@ objects mentioned below.
187187
### Seats Occupied by a Request
188188
189189
The above description of concurrency management is the baseline story.
190-
In it, requests have different durations but are counted equally at
191-
any given moment when comparing against a priority level's concurrency
192-
limit. In the baseline story, each request occupies one unit of
193-
concurrency. The word "seat" is used to mean one unit of concurrency,
194-
inspired by the way each passenger on a train or aircraft takes up one
195-
of the fixed supply of seats.
190+
Requests have different durations but are counted equally at any given
191+
moment when comparing against a priority level's concurrency limit. In
192+
the baseline story, each request occupies one unit of concurrency. The
193+
word "seat" is used to mean one unit of concurrency, inspired by the
194+
way each passenger on a train or aircraft takes up one of the fixed
195+
supply of seats.
196196
197197
But some requests take up more than one seat. Some of these are **list**
198198
requests that the server estimates will return a large number of
199199
objects. These have been found to put an exceptionally heavy burden
200-
on the server, among requests that take a similar amount of time to
201-
run. For this reason, the server estimates the number of objects that
202-
will be returned and considers the request to take a number of seats
200+
on the server. For this reason, the server estimates the number of objects
201+
that will be returned and considers the request to take a number of seats
203202
that is proportional to that estimated number.
204203
-->
205204
### 请求占用的席位 {#seats-occupied-by-a-request}
206205

207-
上述并发管理的描述是基线情况。其中,各个请求具有不同的持续时间,
206+
上述并发管理的描述是基线情况。各个请求具有不同的持续时间,
208207
但在与一个优先级的并发限制进行比较时,这些请求在任何给定时刻都以同等方式进行计数。
209208
在这个基线场景中,每个请求占用一个并发单位。
210209
我们用 “席位(Seat)” 一词来表示一个并发单位,其灵感来自火车或飞机上每位乘客占用一个固定座位的供应方式。
211210

212211
但有些请求所占用的席位不止一个。有些请求是服务器预估将返回大量对象的 **list** 请求。
213-
和所需运行时间相近的其他请求相比,我们发现这类请求会给服务器带来异常沉重的负担。
212+
我们发现这类请求会给服务器带来异常沉重的负担。
214213
出于这个原因,服务器估算将返回的对象数量,并认为请求所占用的席位数与估算得到的数量成正比。
215214

216215
<!--
@@ -506,16 +505,15 @@ https://play.golang.org/p/Gi0PLgVHiUg , which computes this table.
506505
### FlowSchema
507506
508507
A FlowSchema matches some inbound requests and assigns them to a
509-
priority level. Every inbound request is tested against every
510-
FlowSchema in turn, starting with those with numerically lowest ---
511-
which we take to be the logically highest --- `matchingPrecedence` and
512-
working onward. The first match wins.
508+
priority level. Every inbound request is tested against FlowSchemas,
509+
starting with those with the numerically lowest `matchingPrecedence` and
510+
working upward. The first match wins.
513511
-->
514512
### FlowSchema
515513

516514
FlowSchema 匹配一些入站请求,并将它们分配给优先级。
517-
每个入站请求都会对所有 FlowSchema 测试是否匹配,
518-
首先从 `matchingPrecedence` 数值最低的匹配开始(我们认为这是逻辑上的最高优先级)
515+
每个入站请求都会对 FlowSchema 测试是否匹配,
516+
首先从 `matchingPrecedence` 数值最低的匹配开始,
519517
然后依次进行,直到首个匹配出现。
520518

521519
{{< caution >}}
@@ -537,7 +535,7 @@ ensure that no two FlowSchemas have the same `matchingPrecedence`.
537535
A FlowSchema matches a given request if at least one of its `rules`
538536
matches. A rule matches if at least one of its `subjects` *and* at least
539537
one of its `resourceRules` or `nonResourceRules` (depending on whether the
540-
incoming request is for a resource or non-resource URL) matches the request.
538+
incoming request is for a resource or non-resource URL) match the request.
541539
-->
542540
当给定的请求与某个 FlowSchema 的 `rules` 的其中一条匹配,那么就认为该请求与该 FlowSchema 匹配。
543541
判断规则与该请求是否匹配,**不仅**要求该条规则的 `subjects` 字段至少存在一个与该请求相匹配,
@@ -556,19 +554,18 @@ effectively removing it from consideration.
556554

557555
<!--
558556
A FlowSchema's `distinguisherMethod.type` determines how requests matching that
559-
schema will be separated into flows. It may be
560-
either `ByUser`, in which case one requesting user will not be able to starve
561-
other users of capacity, or `ByNamespace`, in which case requests for resources
562-
in one namespace will not be able to starve requests for resources in other
563-
namespaces of capacity, or it may be blank (or `distinguisherMethod` may be
564-
omitted entirely), in which case all requests matched by this FlowSchema will be
557+
schema will be separated into flows. It may be `ByUser`, in which one requesting
558+
user will not be able to starve other users of capacity; `ByNamespace`, in which
559+
requests for resources in one namespace will not be able to starve requests for
560+
resources in other namespaces of capacity; or blank (or `distinguisherMethod` may be
561+
omitted entirely), in which all requests matched by this FlowSchema will be
565562
considered part of a single flow. The correct choice for a given FlowSchema
566563
depends on the resource and your particular environment.
567564
-->
568565
FlowSchema 的 `distinguisherMethod.type` 字段决定了如何把与该模式匹配的请求分散到各个流中。
569566
可能是 `ByUser`,在这种情况下,一个请求用户将无法饿死其他容量的用户;
570567
或者是 `ByNamespace`,在这种情况下,一个名字空间中的资源请求将无法饿死其它名字空间的资源请求;
571-
或者它可以为空(或者可以完全省略 `distinguisherMethod`),
568+
或者为空(或者可以完全省略 `distinguisherMethod`),
572569
在这种情况下,与此 FlowSchema 匹配的请求将被视为单个流的一部分。
573570
资源和你的特定环境决定了如何选择正确一个 FlowSchema。
574571

@@ -763,7 +760,7 @@ for an annotation with key `apf.kubernetes.io/autoupdate-spec`. If
763760
there is such an annotation and its value is `true` then the
764761
kube-apiservers control the object. If there is such an annotation
765762
and its value is `false` then the users control the object. If
766-
neither of those condtions holds then the `metadata.generation` of the
763+
neither of those conditions holds then the `metadata.generation` of the
767764
object is consulted. If that is 1 then the kube-apiservers control
768765
the object. Otherwise the users control the object. These rules were
769766
introduced in release 1.22 and their consideration of
@@ -902,26 +899,26 @@ poorly-behaved workloads that may be harming system health.
902899
broken down by the labels `flow_schema` (indicating the one that
903900
matched the request), `priority_level` (indicating the one to which
904901
the request was assigned), and `reason`. The `reason` label will be
905-
have one of the following values:
902+
one of the following values:
906903
-->
907904
* `apiserver_flowcontrol_rejected_requests_total` 是一个计数器向量,
908905
记录被拒绝的请求数量(自服务器启动以来累计值),
909906
由标签 `flow_chema`(表示与请求匹配的 FlowSchema)、`priority_level`
910907
(表示分配给请该求的优先级)和 `reason` 来区分。
911-
`reason` 标签将具有以下值之一
908+
`reason` 标签将是以下值之一
912909

913910
<!--
914911
* `queue-full`, indicating that too many requests were already
915-
queued,
912+
queued.
916913
* `concurrency-limit`, indicating that the
917914
PriorityLevelConfiguration is configured to reject rather than
918-
queue excess requests, or
915+
queue excess requests.
919916
* `time-out`, indicating that the request was still in the queue
920917
when its queuing time limit expired.
921918
* `cancelled`, indicating that the request is not purge locked
922-
and has been ejected from the queue.
919+
and has been ejected from the queue.
923920
-->
924-
* `queue-full`,表明已经有太多请求排队
921+
* `queue-full`,表明已经有太多请求排队
925922
* `concurrency-limit`,表示将 PriorityLevelConfiguration 配置为
926923
`Reject` 而不是 `Queue`,或者
927924
* `time-out`,表示在其排队时间超期的请求仍在队列中。
@@ -930,14 +927,12 @@ poorly-behaved workloads that may be harming system health.
930927
<!--
931928
* `apiserver_flowcontrol_dispatched_requests_total` is a counter
932929
vector (cumulative since server start) of requests that began
933-
executing, broken down by the labels `flow_schema` (indicating the
934-
one that matched the request) and `priority_level` (indicating the
935-
one to which the request was assigned).
930+
executing, broken down by `flow_schema` and `priority_level`.
936931
-->
937932
* `apiserver_flowcontrol_dispatched_requests_total` 是一个计数器向量,
938933
记录开始执行的请求数量(自服务器启动以来的累积值),
939-
由标签 `flow_schema`(表示与请求匹配的 FlowSchema)和
940-
`priority_level`(表示分配给该请求的优先级)来区分。
934+
`flow_schema``priority_level` 来区分。
935+
941936

942937
<!--
943938
* `apiserver_current_inqueue_requests` is a gauge vector of recent
@@ -962,10 +957,10 @@ poorly-behaved workloads that may be harming system health.
962957
nanosecond, of the number of requests broken down by the labels
963958
`phase` (which takes on the values `waiting` and `executing`) and
964959
`request_kind` (which takes on the values `mutating` and
965-
`readOnly`). Each observed value is a ratio, between 0 and 1, of a
966-
number of requests divided by the corresponding limit on the number
967-
of requests (queue volume limit for waiting and concurrency limit
968-
for executing).
960+
`readOnly`). Each observed value is a ratio, between 0 and 1, of
961+
the number of requests divided by the corresponding limit on the
962+
number of requests (queue volume limit for waiting and concurrency
963+
limit for executing).
969964
-->
970965
* `apiserver_flowcontrol_read_vs_write_current_requests` 是一个直方图向量,
971966
在每个纳秒结束时记录请求数量的观察值,由标签 `phase`(取值为 `waiting``executing`
@@ -976,29 +971,28 @@ poorly-behaved workloads that may be harming system health.
976971
<!--
977972
* `apiserver_flowcontrol_current_inqueue_requests` is a gauge vector
978973
holding the instantaneous number of queued (not executing) requests,
979-
broken down by the labels `priority_level` and `flow_schema`.
974+
broken down by `priority_level` and `flow_schema`.
980975
-->
981976
* `apiserver_flowcontrol_current_inqueue_requests` 是一个表向量,
982977
记录包含排队中的(未执行)请求的瞬时数量,
983-
由标签 `priority_level``flow_schema` 区分。
978+
`priority_level``flow_schema` 区分。
984979

985980
<!--
986981
* `apiserver_flowcontrol_current_executing_requests` is a gauge vector
987982
holding the instantaneous number of executing (not waiting in a
988-
queue) requests, broken down by the labels `priority_level` and
989-
`flow_schema`.
983+
queue) requests, broken down by `priority_level` and `flow_schema`.
990984
-->
991985
* `apiserver_flowcontrol_current_executing_requests` 是一个表向量,
992986
记录包含执行中(不在队列中等待)请求的瞬时数量,
993-
由标签 `priority_level``flow_schema` 进一步区分。
987+
`priority_level``flow_schema` 进一步区分。
994988

995989
<!--
996990
* `apiserver_flowcontrol_request_concurrency_in_use` is a gauge vector
997991
holding the instantaneous number of occupied seats, broken down by
998-
the labels `priority_level` and `flow_schema`.
992+
`priority_level` and `flow_schema`.
999993
-->
1000994
* `apiserver_flowcontrol_request_concurrency_in_use` 是一个规范向量,
1001-
包含占用座位的瞬时数量,由标签 `priority_level``flow_schema` 进一步区分。
995+
包含占用座位的瞬时数量, `priority_level``flow_schema` 进一步区分。
1002996

1003997
<!--
1004998
* `apiserver_flowcontrol_priority_level_request_utilization` is a
@@ -1040,14 +1034,13 @@ poorly-behaved workloads that may be harming system health.
10401034
<!--
10411035
* `apiserver_flowcontrol_request_queue_length_after_enqueue` is a
10421036
histogram vector of queue lengths for the queues, broken down by
1043-
the labels `priority_level` and `flow_schema`, as sampled by the
1044-
enqueued requests. Each request that gets queued contributes one
1045-
sample to its histogram, reporting the length of the queue immediately
1046-
after the request was added. Note that this produces different
1047-
statistics than an unbiased survey would.
1037+
`priority_level` and `flow_schema`, as sampled by the enqueued requests.
1038+
Each request that gets queued contributes one sample to its histogram,
1039+
reporting the length of the queue immediately after the request was added.
1040+
Note that this produces different statistics than an unbiased survey would.
10481041
-->
10491042
* `apiserver_flowcontrol_request_queue_length_after_enqueue` 是一个直方图向量,
1050-
记录请求队列的长度,由标签 `priority_level``flow_schema` 进一步区分。
1043+
记录请求队列的长度, `priority_level``flow_schema` 进一步区分。
10511044
每个排队中的请求都会为其直方图贡献一个样本,并在添加请求后立即上报队列的长度。
10521045
请注意,这样产生的统计数据与无偏调查不同。
10531046

@@ -1137,6 +1130,14 @@ poorly-behaved workloads that may be harming system health.
11371130
* `apiserver_flowcontrol_demand_seats_stdev` 是一个表向量,
11381131
为每个优先级包含了上一个并发度借用调整期间所观察到的席位需求的时间加权总标准偏差。
11391132

1133+
<!--
1134+
* `apiserver_flowcontrol_demand_seats_smoothed` is a gauge vector
1135+
holding, for each priority level, the smoothed enveloped seat demand
1136+
determined at the last concurrency adjustment.
1137+
-->
1138+
* `apiserver_flowcontrol_demand_seats_smoothed` 是一个表向量,
1139+
为每个优先级包含了上一个并发度调整期间确定的平滑包络席位需求。
1140+
11401141
<!--
11411142
* `apiserver_flowcontrol_target_seats` is a gauge vector holding, for
11421143
each priority level, the concurrency target going into the borrowing
@@ -1163,16 +1164,13 @@ poorly-behaved workloads that may be harming system health.
11631164
<!--
11641165
* `apiserver_flowcontrol_request_wait_duration_seconds` is a histogram
11651166
vector of how long requests spent queued, broken down by the labels
1166-
`flow_schema` (indicating which one matched the request),
1167-
`priority_level` (indicating the one to which the request was
1168-
assigned), and `execute` (indicating whether the request started
1169-
executing).
1167+
`flow_schema`, `priority_level`, and `execute`. The `execute` label
1168+
indicates whether the request has started executing.
11701169
-->
11711170
* `apiserver_flowcontrol_request_wait_duration_seconds` 是一个直方图向量,
11721171
记录请求排队的时间,
1173-
由标签 `flow_schema`(表示与请求匹配的 FlowSchema),
1174-
`priority_level`(表示分配该请求的优先级)
1175-
`execute`(表示请求是否开始执行)进一步区分。
1172+
由标签 `flow_schema``priority_level``execute` 进一步区分。
1173+
标签 `execute` 表示请求是否开始执行。
11761174

11771175
{{< note >}}
11781176
<!--
@@ -1188,14 +1186,11 @@ poorly-behaved workloads that may be harming system health.
11881186
<!--
11891187
* `apiserver_flowcontrol_request_execution_seconds` is a histogram
11901188
vector of how long requests took to actually execute, broken down by
1191-
the labels `flow_schema` (indicating which one matched the request)
1192-
and `priority_level` (indicating the one to which the request was
1193-
assigned).
1189+
`flow_schema` and `priority_level`.
11941190
-->
11951191
* `apiserver_flowcontrol_request_execution_seconds` 是一个直方图向量,
11961192
记录请求实际执行需要花费的时间,
1197-
由标签 `flow_schema`(表示与请求匹配的 FlowSchema)和
1198-
`priority_level`(表示分配给该请求的优先级)进一步区分。
1193+
由标签 `flow_schema``priority_level` 进一步区分。
11991194

12001195
<!--
12011196
* `apiserver_flowcontrol_watch_count_samples` is a histogram vector of
@@ -1218,23 +1213,20 @@ poorly-behaved workloads that may be harming system health.
12181213

12191214
<!--
12201215
* `apiserver_flowcontrol_request_dispatch_no_accommodation_total` is a
1221-
counter vec of the number of events that in principle could have led
1216+
counter vector of the number of events that in principle could have led
12221217
to a request being dispatched but did not, due to lack of available
1223-
concurrency, broken down by `flow_schema` and `priority_level`. The
1224-
relevant sorts of events are arrival of a request and completion of
1225-
a request.
1218+
concurrency, broken down by `flow_schema` and `priority_level`.
12261219
-->
12271220
* `apiserver_flowcontrol_request_dispatch_no_accommodation_total`
12281221
是一个事件数量的计数器,这些事件在原则上可能导致请求被分派,
12291222
但由于并发度不足而没有被分派,
12301223
由标签 `flow_schema``priority_level` 进一步区分。
1231-
相关的事件类型是请求的到达和请求的完成。
12321224

12331225
<!--
12341226
### Debug endpoints
12351227
12361228
When you enable the API Priority and Fairness feature, the `kube-apiserver`
1237-
serves the following additional paths at its HTTP[S] ports.
1229+
serves the following additional paths at its HTTP(S) ports.
12381230
-->
12391231
### 调试端点 {#debug-endpoints}
12401232

@@ -1371,7 +1363,7 @@ request, and it includes the following attributes.
13711363

13721364
<!--
13731365
At higher levels of verbosity there will be log lines exposing details
1374-
of how APF handled the request, primarily for debug purposes.
1366+
of how APF handled the request, primarily for debugging purposes.
13751367
-->
13761368
在更高级别的精细度下,将有日志行揭示 APF 如何处理请求的详细信息,主要用于调试目的。
13771369

@@ -1404,4 +1396,3 @@ or the feature's [slack channel](https://kubernetes.slack.com/messages/api-prior
14041396
请参阅[增强提案](https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1040-priority-and-fairness)
14051397
你可以通过 [SIG API Machinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery/)
14061398
或特性的 [Slack 频道](https://kubernetes.slack.com/messages/api-priority-and-fairness/)提出建议和特性请求。
1407-

0 commit comments

Comments
 (0)