-
Notifications
You must be signed in to change notification settings - Fork 40.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for HTTP/2 max streams per connection setting #60054
Fixes for HTTP/2 max streams per connection setting #60054
Conversation
All the tests are failing with the following complaint:
But |
/test pull-kubernetes-e2e-gce-device-plugin-gpu |
84231b5
to
930fd6d
Compare
/assign thockin |
/approve lgtm /assign sttts @sttts merge at your discretion. |
@@ -83,6 +86,7 @@ func NewSecureServingOptions() *SecureServingOptions { | |||
PairName: "apiserver", | |||
CertDirectory: "apiserver.local.config/certificates", | |||
}, | |||
HTTP2MaxStreamsPerConnection: 1000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any side-effects of this? Memory, cpu, ...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default here is for every apiserver, and even controller-manager and soon'ish the scheduler. Maybe we should only change Golang's default for kube-apiserver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course this affects memory, CPU, and network load. I agree it would be better for each program to have its own default. It would be even better if a server could tailor this limit to each individual client. What would you suggest as the API for either of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave the default at 0 (go default) and override it in kube-aggregator and kube-apiserver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the use case that concerns me is an aggregated api-server. One of those today tells the main api-server to limit itself to 250 open streams in its HTTP/2 connection to the aggregated api-server. The pain point was having more than 250 watches open from controllers that connect to the main api-server. Those connections work just fine, it is where the proxy function multiplexes them all into one HTTP/2 connection to the aggregated api-server that the current limit bites. So I will update just the sample-apiserver to override the limit.
This is probably also worth a cherry-pick to 1.9 after it is merged. |
930fd6d
to
2f2ff19
Compare
@@ -52,7 +52,11 @@ func NewWardleServerOptions(out, errOut io.Writer) *WardleServerOptions { | |||
StdOut: out, | |||
StdErr: errOut, | |||
} | |||
|
|||
if o.RecommendedOptions != nil && o.RecommendedOptions.SecureServing != nil && o.RecommendedOptions.SecureServing.SecureServingOptions != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to check for any of the nils here.
377f893
to
f89946f
Compare
This PR makes two changes. One is to introduce a parameter for the HTTP/2 setting that an api-server sends to its clients telling them how many streams they may have concurrently open in an HTTP/2 connection. If left at its default value of zero, this means to use the default in golang's HTTP/2 code (which is currently 250). The other change is to make the recommended options for an aggregated api-server set this limit to 1000. The limit of 250 is annoyingly low for the use case of many controllers watching objects of Kinds served by an aggregated api-server reached through the main api-server (in its mode as a proxy for the aggregated api-server, in which it uses a single HTTP/2 connection for all calls proxied to that aggregated api-server). Fixes kubernetes#60042
f89946f
to
201c11f
Compare
I know too little about this area, so punting to others who know it better. Assign back to me if approval is needed. |
/lgtm |
/assign @thockin This has no influence on any kubernetes binary we ship, but only on aggregated API servers building on our libraries. But for the later and any non-trivial use this is crucial. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, MikeSpreitzer, sttts, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Automatic merge from submit-queue (batch tested with PRs 60054, 60202, 60219, 58090, 60275). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Commit found in the "release-1.9" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
What this PR does / why we need it:
This PR makes two changes. One is to introduce a parameter
for the HTTP/2 setting that an api-server sends to its clients
telling them how many streams they may have concurrently open in
an HTTP/2 connection. If left at its default value of zero,
this means to use the default in golang's HTTP/2 code (which
is currently 250; see https://github.com/golang/net/blob/master/http2/server.go).
The other change is to make the recommended options for an aggregated
api-server set this limit to 1000. The limit of 250 is annoyingly low
for the use case of many controllers watching objects of Kinds served
by an aggregated api-server reached through the main api-server (in
its mode as a proxy for the aggregated api-server, in which it uses a
single HTTP/2 connection for all calls proxied to that aggregated
api-server).
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #60042
Special notes for your reviewer:
Release note: