Commit Graph

38 Commits

Author SHA1 Message Date
Mike Spreitzer
feb4227788 apiserver: finish implementation of borrowing in APF
Also make some design changes exposed in testing and review.

Do not remove the ambiguous old metric
`apiserver_flowcontrol_request_concurrency_limit` because reviewers
though it is too early.  This creates a problem, that metric can not
keep both of its old meanings.  I chose the configured concurrency
limit.

Testing has revealed a design flaw, which concerns the initialization
of the seat demand state tracking.  The current design in the KEP is
as follows.

> Adjustment is also done on configuration change … For a newly
> introduced priority level, we set HighSeatDemand, AvgSeatDemand, and
> SmoothSeatDemand to NominalCL-LendableSD/2 and StDevSeatDemand to
> zero.

But this does not work out well at server startup.  As part of its
construction, the APF controller does a configuration change with zero
objects read, to initialize its request-handling state.  As always,
the two mandatory priority levels are implicitly added whenever they
are not read.  So this initial reconfig has one non-exempt priority
level, the mandatory one called catch-all --- and it gets its
SmoothSeatDemand initialized to the whole server concurrency limit.
From there it decays slowly, as per the regular design.  So for a
fairly long time, it appears to have a high demand and competes
strongly with the other priority levels.  Its Target is higher than
all the others, once they start to show up.  It properly gets a low
NominalCL once other levels show up, which actually makes it compete
harder for borrowing: it has an exceptionally high Target and a rather
low NominalCL.

I have considered the following fix.  The idea is that the designed
initialization is not appropriate before all the default objects are
read.  So the fix is to have a mode bit in the controller.  In the
initial state, those seat demand tracking variables are set to zero.
Once the config-producing controller detects that all the default
objects are pre-existing, it flips the mode bit.  In the later mode,
the seat demand tracking variables are initialized as originally
designed.

However, that still gives preferential treatment to the default
PriorityLevelConfiguration objects, over any that may be added later.

So I have made a universal and simpler fix: always initialize those
seat demand tracking variables to zero.  Even if a lot of load shows
up quickly, remember that adjustments are frequent (every 10 sec) and
the very next one will fully respond to that load.

Also: revise logging logic, to log at numerically lower V level when
there is a change.

Also: bug fix in float64close.

Also, separate imports in some file

Co-authored-by: Han Kang <hankang@google.com>
2022-11-08 21:51:44 -08:00
Abu Kashem
66fc0d7037
rename assuredConcurrencyShares for flowcontrol v1beta3 2022-09-26 15:34:10 -04:00
Abu Kashem
6edc251686
apiserver: update apf tests to use v1beta3 2022-09-21 18:54:20 -04:00
Jordan Liggitt
9cfc128b8e
Simplify P&F concurrency test 2022-09-19 08:26:29 -04:00
Kubernetes Prow Robot
068743f937
Merge pull request #111148 from cyang49/master
APF concurrency isolation integration test
2022-08-23 16:05:02 -07:00
Chih-Chieh Yang
94097457fd Minor fixes 2022-08-09 12:19:00 +00:00
Chih-Chieh Yang
3c31efe32f Add more comment and clip negative value to prevent Sqrt error 2022-08-03 15:16:26 +00:00
Chih-Chieh Yang
c70ec593ec Fix minor issues and clean up 2022-08-03 14:14:36 +00:00
Chih-Chieh Yang
07e2bfe1cc Refactor and clean up the code 2022-08-02 14:29:03 +00:00
Chih-Chieh Yang
ed74de833d Add comment for the reason this test is needed 2022-07-30 00:13:48 +00:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Chih-Chieh Yang
4fc7fd25bf Fix the apf metrics names 2022-07-15 18:27:29 +00:00
Chih-Chieh Yang
b0c211a1e5 Fix PL seat util metric retrieval 2022-07-15 17:11:16 +00:00
Chih-Chieh Yang
f298d506e8 APF concurrency isolation integration test (#1)
* Add APF concurrency utilization test
2022-07-15 17:11:16 +00:00
Wojciech Tyczyński
6b59525746 Clean shutdown of flowcontrol integration tests 2022-06-15 16:53:42 +02:00
Mike Spreitzer
1f1cfba2a3 Remove the PairVec types 2022-06-12 23:37:15 -04:00
Mike Spreitzer
7d64a93a14 Give apf metrics abstractions more familiar names
The logic is similar to Prometheus gauges and vectors,
adopt that terminology.
2022-05-23 16:09:43 -04:00
Wojciech Tyczyński
73da6d15f9 Fix TestPriorityLevelIsolation concurrency issue 2022-04-19 15:59:14 +02:00
Jeffrey Ying
ecb9b620fe
Revert "Populate OpenAPI in all integration tests" 2022-01-26 13:30:03 -05:00
Jefftree
eb8f6fe0f9 Populate OpenAPI in all integration tests 2022-01-25 14:16:31 -08:00
Mike Spreitzer
23af47395b Test isolation among FlowSchemaStatus Conditions 2022-01-17 15:43:37 -05:00
Mike Spreitzer
154bf6aab3 Add metrics about watch counts seen by APF 2021-11-01 16:02:49 -04:00
Madhav Jivrajani
fed2ec99c6 migrate k8s.io/apimachinery/util/clock -> k8s.io/utils/clock
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2021-09-21 15:54:44 +05:30
Abu Kashem
d99497ef6d
apf: update e2e test to use v1beta2 2021-09-09 08:28:58 -04:00
Mengjiao Liu
ac5535c949 test/integration: Rename MasterConfigOptions to ControlPlaneConfigOptions 2021-06-08 16:58:46 +08:00
Mengjiao Liu
6871b2b3c7 Rename masterConfig to controlPlaneConfig 2021-06-04 20:55:08 +08:00
Mengjiao Liu
387154f1a9 Part3: master to controlplane in test/integration
Rename RunAMaster to RunAControlPlane
2021-06-03 11:06:19 +08:00
Mengjiao Liu
c9ec486287 Part of master to controlplane in test/integration
Rename NewIntegrationTestMasterConfig to NewIntegrationTestControlPlaneConfig
2021-05-25 13:26:28 +08:00
David Eads
80ff06fe84 Enable, rate limit, and test APF controller fights
Using real time.
2021-03-08 16:24:39 -05:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
yue9944882
849be447f5 APF: graduate API and types to beta
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2020-11-13 23:20:39 +00:00
Adhityaa Chandrasekar
f9d57a8d5d APF: use snake_case in metric labels
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2020-11-04 22:19:54 +00:00
Daniel Smith
a86afc12df update scripts 2020-09-02 10:49:40 -07:00
Daniel Smith
15e0e3e90e rename 2020-09-02 10:48:26 -07:00
yue9944882
40f3242cd9 apf integration test: ensure no rejection 2020-07-27 10:42:37 +08:00
yue9944882
df5dfb46b7 assert shared concurrency 2020-04-18 01:15:54 +08:00
yue9944882
875407a450 add flowcontrol integration test to import whitelist 2020-04-13 22:33:08 +08:00
yue9944882
30bc0fce48 integration test for priority-level isolation 2020-04-13 22:33:07 +08:00