@@ -81,8 +81,8 @@ APF 适用于 **watch** 请求。当 APF 被禁用时,**watch** 请求不受 `
81
81
82
82
<!--
83
83
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/)
86
86
for a general explanation of feature gates and how to enable and
87
87
disable them. The name of the feature gate for APF is
88
88
"APIPriorityAndFairness". This feature also involves an {{<
@@ -187,30 +187,29 @@ objects mentioned below.
187
187
### Seats Occupied by a Request
188
188
189
189
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.
196
196
197
197
But some requests take up more than one seat. Some of these are **list**
198
198
requests that the server estimates will return a large number of
199
199
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
203
202
that is proportional to that estimated number.
204
203
-->
205
204
### 请求占用的席位 {#seats-occupied-by-a-request}
206
205
207
- 上述并发管理的描述是基线情况。其中, 各个请求具有不同的持续时间,
206
+ 上述并发管理的描述是基线情况。各个请求具有不同的持续时间,
208
207
但在与一个优先级的并发限制进行比较时,这些请求在任何给定时刻都以同等方式进行计数。
209
208
在这个基线场景中,每个请求占用一个并发单位。
210
209
我们用 “席位(Seat)” 一词来表示一个并发单位,其灵感来自火车或飞机上每位乘客占用一个固定座位的供应方式。
211
210
212
211
但有些请求所占用的席位不止一个。有些请求是服务器预估将返回大量对象的 ** list** 请求。
213
- 和所需运行时间相近的其他请求相比, 我们发现这类请求会给服务器带来异常沉重的负担。
212
+ 我们发现这类请求会给服务器带来异常沉重的负担。
214
213
出于这个原因,服务器估算将返回的对象数量,并认为请求所占用的席位数与估算得到的数量成正比。
215
214
216
215
<!--
@@ -506,16 +505,15 @@ https://play.golang.org/p/Gi0PLgVHiUg , which computes this table.
506
505
### FlowSchema
507
506
508
507
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.
513
511
-->
514
512
### FlowSchema
515
513
516
514
FlowSchema 匹配一些入站请求,并将它们分配给优先级。
517
- 每个入站请求都会对所有 FlowSchema 测试是否匹配,
518
- 首先从 ` matchingPrecedence ` 数值最低的匹配开始(我们认为这是逻辑上的最高优先级) ,
515
+ 每个入站请求都会对 FlowSchema 测试是否匹配,
516
+ 首先从 ` matchingPrecedence ` 数值最低的匹配开始,
519
517
然后依次进行,直到首个匹配出现。
520
518
521
519
{{< caution >}}
@@ -537,7 +535,7 @@ ensure that no two FlowSchemas have the same `matchingPrecedence`.
537
535
A FlowSchema matches a given request if at least one of its `rules`
538
536
matches. A rule matches if at least one of its `subjects` *and* at least
539
537
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.
541
539
-->
542
540
当给定的请求与某个 FlowSchema 的 ` rules ` 的其中一条匹配,那么就认为该请求与该 FlowSchema 匹配。
543
541
判断规则与该请求是否匹配,** 不仅** 要求该条规则的 ` subjects ` 字段至少存在一个与该请求相匹配,
@@ -556,19 +554,18 @@ effectively removing it from consideration.
556
554
557
555
<!--
558
556
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
565
562
considered part of a single flow. The correct choice for a given FlowSchema
566
563
depends on the resource and your particular environment.
567
564
-->
568
565
FlowSchema 的 ` distinguisherMethod.type ` 字段决定了如何把与该模式匹配的请求分散到各个流中。
569
566
可能是 ` ByUser ` ,在这种情况下,一个请求用户将无法饿死其他容量的用户;
570
567
或者是 ` ByNamespace ` ,在这种情况下,一个名字空间中的资源请求将无法饿死其它名字空间的资源请求;
571
- 或者它可以为空 (或者可以完全省略 ` distinguisherMethod ` ),
568
+ 或者为空 (或者可以完全省略 ` distinguisherMethod ` ),
572
569
在这种情况下,与此 FlowSchema 匹配的请求将被视为单个流的一部分。
573
570
资源和你的特定环境决定了如何选择正确一个 FlowSchema。
574
571
@@ -763,7 +760,7 @@ for an annotation with key `apf.kubernetes.io/autoupdate-spec`. If
763
760
there is such an annotation and its value is `true` then the
764
761
kube-apiservers control the object. If there is such an annotation
765
762
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
767
764
object is consulted. If that is 1 then the kube-apiservers control
768
765
the object. Otherwise the users control the object. These rules were
769
766
introduced in release 1.22 and their consideration of
@@ -902,26 +899,26 @@ poorly-behaved workloads that may be harming system health.
902
899
broken down by the labels `flow_schema` (indicating the one that
903
900
matched the request), `priority_level` (indicating the one to which
904
901
the request was assigned), and `reason`. The `reason` label will be
905
- have one of the following values:
902
+ one of the following values:
906
903
-->
907
904
* ` apiserver_flowcontrol_rejected_requests_total ` 是一个计数器向量,
908
905
记录被拒绝的请求数量(自服务器启动以来累计值),
909
906
由标签 ` flow_chema ` (表示与请求匹配的 FlowSchema)、` priority_level `
910
907
(表示分配给请该求的优先级)和 ` reason ` 来区分。
911
- ` reason ` 标签将具有以下值之一 :
908
+ ` reason ` 标签将是以下值之一 :
912
909
913
910
<!--
914
911
* `queue-full`, indicating that too many requests were already
915
- queued,
912
+ queued.
916
913
* `concurrency-limit`, indicating that the
917
914
PriorityLevelConfiguration is configured to reject rather than
918
- queue excess requests, or
915
+ queue excess requests.
919
916
* `time-out`, indicating that the request was still in the queue
920
917
when its queuing time limit expired.
921
918
* `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.
923
920
-->
924
- * ` queue-full ` ,表明已经有太多请求排队,
921
+ * ` queue-full ` ,表明已经有太多请求排队
925
922
* ` concurrency-limit ` ,表示将 PriorityLevelConfiguration 配置为
926
923
` Reject ` 而不是 ` Queue ` ,或者
927
924
* ` time-out ` ,表示在其排队时间超期的请求仍在队列中。
@@ -930,14 +927,12 @@ poorly-behaved workloads that may be harming system health.
930
927
<!--
931
928
* `apiserver_flowcontrol_dispatched_requests_total` is a counter
932
929
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`.
936
931
-->
937
932
* ` apiserver_flowcontrol_dispatched_requests_total ` 是一个计数器向量,
938
933
记录开始执行的请求数量(自服务器启动以来的累积值),
939
- 由标签 ` flow_schema ` (表示与请求匹配的 FlowSchema)和
940
- ` priority_level ` (表示分配给该请求的优先级)来区分。
934
+ 由 ` flow_schema ` 和 ` priority_level ` 来区分。
935
+
941
936
942
937
<!--
943
938
* `apiserver_current_inqueue_requests` is a gauge vector of recent
@@ -962,10 +957,10 @@ poorly-behaved workloads that may be harming system health.
962
957
nanosecond, of the number of requests broken down by the labels
963
958
`phase` (which takes on the values `waiting` and `executing`) and
964
959
`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).
969
964
-->
970
965
* ` apiserver_flowcontrol_read_vs_write_current_requests ` 是一个直方图向量,
971
966
在每个纳秒结束时记录请求数量的观察值,由标签 ` phase ` (取值为 ` waiting ` 及 ` executing ` )
@@ -976,29 +971,28 @@ poorly-behaved workloads that may be harming system health.
976
971
<!--
977
972
* `apiserver_flowcontrol_current_inqueue_requests` is a gauge vector
978
973
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`.
980
975
-->
981
976
* ` apiserver_flowcontrol_current_inqueue_requests ` 是一个表向量,
982
977
记录包含排队中的(未执行)请求的瞬时数量,
983
- 由标签 ` priority_level ` 和 ` flow_schema ` 区分。
978
+ 由 ` priority_level ` 和 ` flow_schema ` 区分。
984
979
985
980
<!--
986
981
* `apiserver_flowcontrol_current_executing_requests` is a gauge vector
987
982
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`.
990
984
-->
991
985
* ` apiserver_flowcontrol_current_executing_requests ` 是一个表向量,
992
986
记录包含执行中(不在队列中等待)请求的瞬时数量,
993
- 由标签 ` priority_level ` 和 ` flow_schema ` 进一步区分。
987
+ 由 ` priority_level ` 和 ` flow_schema ` 进一步区分。
994
988
995
989
<!--
996
990
* `apiserver_flowcontrol_request_concurrency_in_use` is a gauge vector
997
991
holding the instantaneous number of occupied seats, broken down by
998
- the labels `priority_level` and `flow_schema`.
992
+ `priority_level` and `flow_schema`.
999
993
-->
1000
994
* ` apiserver_flowcontrol_request_concurrency_in_use ` 是一个规范向量,
1001
- 包含占用座位的瞬时数量,由标签 ` priority_level ` 和 ` flow_schema ` 进一步区分。
995
+ 包含占用座位的瞬时数量,由 ` priority_level ` 和 ` flow_schema ` 进一步区分。
1002
996
1003
997
<!--
1004
998
* `apiserver_flowcontrol_priority_level_request_utilization` is a
@@ -1040,14 +1034,13 @@ poorly-behaved workloads that may be harming system health.
1040
1034
<!--
1041
1035
* `apiserver_flowcontrol_request_queue_length_after_enqueue` is a
1042
1036
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.
1048
1041
-->
1049
1042
* ` apiserver_flowcontrol_request_queue_length_after_enqueue ` 是一个直方图向量,
1050
- 记录请求队列的长度,由标签 ` priority_level ` 和 ` flow_schema ` 进一步区分。
1043
+ 记录请求队列的长度,由 ` priority_level ` 和 ` flow_schema ` 进一步区分。
1051
1044
每个排队中的请求都会为其直方图贡献一个样本,并在添加请求后立即上报队列的长度。
1052
1045
请注意,这样产生的统计数据与无偏调查不同。
1053
1046
@@ -1137,6 +1130,14 @@ poorly-behaved workloads that may be harming system health.
1137
1130
* ` apiserver_flowcontrol_demand_seats_stdev ` 是一个表向量,
1138
1131
为每个优先级包含了上一个并发度借用调整期间所观察到的席位需求的时间加权总标准偏差。
1139
1132
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
+
1140
1141
<!--
1141
1142
* `apiserver_flowcontrol_target_seats` is a gauge vector holding, for
1142
1143
each priority level, the concurrency target going into the borrowing
@@ -1163,16 +1164,13 @@ poorly-behaved workloads that may be harming system health.
1163
1164
<!--
1164
1165
* `apiserver_flowcontrol_request_wait_duration_seconds` is a histogram
1165
1166
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.
1170
1169
-->
1171
1170
* ` apiserver_flowcontrol_request_wait_duration_seconds ` 是一个直方图向量,
1172
1171
记录请求排队的时间,
1173
- 由标签 ` flow_schema ` (表示与请求匹配的 FlowSchema),
1174
- ` priority_level ` (表示分配该请求的优先级)
1175
- 和 ` execute ` (表示请求是否开始执行)进一步区分。
1172
+ 由标签 ` flow_schema ` 、` priority_level ` 和 ` execute ` 进一步区分。
1173
+ 标签 ` execute ` 表示请求是否开始执行。
1176
1174
1177
1175
{{< note >}}
1178
1176
<!--
@@ -1188,14 +1186,11 @@ poorly-behaved workloads that may be harming system health.
1188
1186
<!--
1189
1187
* `apiserver_flowcontrol_request_execution_seconds` is a histogram
1190
1188
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`.
1194
1190
-->
1195
1191
* ` apiserver_flowcontrol_request_execution_seconds ` 是一个直方图向量,
1196
1192
记录请求实际执行需要花费的时间,
1197
- 由标签 ` flow_schema ` (表示与请求匹配的 FlowSchema)和
1198
- ` priority_level ` (表示分配给该请求的优先级)进一步区分。
1193
+ 由标签 ` flow_schema ` 和 ` priority_level ` 进一步区分。
1199
1194
1200
1195
<!--
1201
1196
* `apiserver_flowcontrol_watch_count_samples` is a histogram vector of
@@ -1218,23 +1213,20 @@ poorly-behaved workloads that may be harming system health.
1218
1213
1219
1214
<!--
1220
1215
* `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
1222
1217
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`.
1226
1219
-->
1227
1220
* ` apiserver_flowcontrol_request_dispatch_no_accommodation_total `
1228
1221
是一个事件数量的计数器,这些事件在原则上可能导致请求被分派,
1229
1222
但由于并发度不足而没有被分派,
1230
1223
由标签 ` flow_schema ` 和 ` priority_level ` 进一步区分。
1231
- 相关的事件类型是请求的到达和请求的完成。
1232
1224
1233
1225
<!--
1234
1226
### Debug endpoints
1235
1227
1236
1228
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.
1238
1230
-->
1239
1231
### 调试端点 {#debug-endpoints}
1240
1232
@@ -1371,7 +1363,7 @@ request, and it includes the following attributes.
1371
1363
1372
1364
<!--
1373
1365
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.
1375
1367
-->
1376
1368
在更高级别的精细度下,将有日志行揭示 APF 如何处理请求的详细信息,主要用于调试目的。
1377
1369
@@ -1404,4 +1396,3 @@ or the feature's [slack channel](https://kubernetes.slack.com/messages/api-prior
1404
1396
请参阅[ 增强提案] ( https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1040-priority-and-fairness ) 。
1405
1397
你可以通过 [ SIG API Machinery] ( https://github.com/kubernetes/community/tree/master/sig-api-machinery/ )
1406
1398
或特性的 [ Slack 频道] ( https://kubernetes.slack.com/messages/api-priority-and-fairness/ ) 提出建议和特性请求。
1407
-
0 commit comments