Skip to content
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

Settings for http2 initial stream/connection window sizes #34169

Closed
okhaliavka opened this issue Jul 20, 2021 · 20 comments
Closed

Settings for http2 initial stream/connection window sizes #34169

okhaliavka opened this issue Jul 20, 2021 · 20 comments
Labels
area/networking kind/enhancement lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while

Comments

@okhaliavka
Copy link

okhaliavka commented Jul 20, 2021

Describe the feature request
Istio should have global setting(s) for initial_stream_window_size and initial_connection_window_size that go into listeners and http2 clusters that pilot generates. Envoy's default of 256MB is often too much. For us, it's causing trouble with sidecars' memory usage, and decreasing these window sizes helps. We would like to decrease it once and for all connections, but have found that it's impossible, since setting http2_protocol_options on a cluster makes envoy think that upstream supports http2. While this is often useful for outbound clusters and works fairly well, this is very problematic for inbound clusters, leaving us no choice but to configure it individually for every http2 workload.

We're not the first ones having problems with http2 flow control defaults:

Describe alternatives you've considered
EnvoyFilter. It works for listeners, but doesn't for clusters for the reasons described above. It could work if EnvoyFilter's ClusterMatch allowed to filter clusters with present http2_protocol_options though.

[ ] Docs
[ ] Installation
[x] Networking
[ ] Performance and Scalability
[ ] Extensions and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure

@okhaliavka okhaliavka changed the title Settings for http2 initial stream/connection window sizes. Settings for http2 initial stream/connection window sizes Jul 20, 2021
@ramaraochavali
Copy link
Contributor

@akhalyavka are you suggesting to have to global default for all or do you need this configurability at individual service?

@okhaliavka
Copy link
Author

@ramaraochavali Global defaults. Configurability at individual service would be nice too, but it's at least possible with EnvoyFilter.

@istio-policy-bot istio-policy-bot added the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Feb 2, 2022
@istio-policy-bot istio-policy-bot added the lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. label Feb 17, 2022
@lambdai
Copy link
Contributor

lambdai commented Mar 10, 2022

Still an ongoing issue

@lambdai lambdai reopened this Mar 10, 2022
@istio-policy-bot istio-policy-bot removed the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Mar 10, 2022
@zirain
Copy link
Member

zirain commented Jul 4, 2022

seems we still need this? cc @hzxuzhonghu

@zirain zirain reopened this Jul 4, 2022
@zirain zirain removed the lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. label Jul 4, 2022
@ramaraochavali
Copy link
Contributor

Configurability at individual service would be nice too, but it's at least possible with EnvoyFilter.

Same is possible for global also with Envoy filter in root namespace without any workload selector.

@manderson23
Copy link

It would be nice if there were simple Istio level options to override these without resorting to EnvoyFilter.

If that isn't possible then having an HTTP2 example with these parameters in the Envoy Filter documentation could help.

@okhaliavka
Copy link
Author

Same is possible for global also with Envoy filter in root namespace without any workload selector.

@ramaraochavali Setting http2_protocol_options on inbound clusters tells envoy to use http2 to talk to the app container.
Doing it globally breaks all applications that do not support http2.

@ramaraochavali
Copy link
Contributor

Setting http2_protocol_options on inbound clusters tells envoy to use http2 to talk to the app container.
Doing it globally breaks all applications that do not support http2.

Sorry I meant having a workload selector like http2_enabled : true in root namespace and all http2 services have that label. But I agree, having service specific config in DR would be better.

@istio-policy-bot istio-policy-bot added the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Mar 1, 2023
@istio-policy-bot istio-policy-bot added the lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. label Mar 16, 2023
@kyessenov kyessenov reopened this Oct 12, 2023
@istio-policy-bot istio-policy-bot removed the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Oct 12, 2023
@kyessenov
Copy link
Contributor

Re-opening since this is a valid request.

CC @briansonnenberg @howardjohn how best to model the config here. Ideally, I'd imagine we want to move away from the 256MB window size by default. That looks great on throughput demos, but adds too much risk to the production deployments.

@keithmattix
Copy link
Contributor

@jaellio is adding a setting for max_concurrent_streams in istio/api#2952 and I think Zack Butcher is adding some connection pool settings in istio/api#2961. Feels like we're wanting a lot of http2 settings in DestinationRule; do we feel like we need a unified approach to these h2 settings?

@kyessenov
Copy link
Contributor

kyessenov commented Oct 12, 2023

I don't have a strong opinion where to put them. We do need them per-hop (app-client, client-server, server-app) and in both directions.

@keithmattix
Copy link
Contributor

+1 on server->app - I've worked with a customer really looking for that functionality

@ZackButcher
Copy link
Contributor

ZackButcher commented Oct 12, 2023

IMO this kind of config makes sense in the connection pool settings -- then as Kuat says they'll apply everywhere (via DestinationRule) and with istio/api#2961 they'll be configurable for the server directly via Sidecar as well.

That begs the larger question (probably not for this thread), do we want to support other TrafficPolicy style configuration via the Sidecar as well? As I called out in this comment, using the full TrafficPolicy in the Sidecar has some interesting possibilities for configuring app-client and server-app (client-server is well-handled by DestinationRule today)

@howardjohn
Copy link
Member

howardjohn commented Oct 12, 2023 via email

@kyessenov
Copy link
Contributor

My feeling is that we probably want to pick a better default. But we need a config setting to opt-out/opt-in during the transition. So we may not need a long term API, but we still need a knob right now.

@hzxuzhonghu
Copy link
Member

I believe the original design is not to include all the configs from envoy, there are tens(maybe hundreds) of them for only protocol-related

@kyessenov
Copy link
Contributor

@hzxuzhonghu Yes that would be the case if the default was good. But it's not - and putting everyone at risk because we don't want to expose a config is not a good strategy.

@hzxuzhonghu
Copy link
Member

Fair point

@istio-policy-bot istio-policy-bot added the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Apr 13, 2024
@istio-policy-bot
Copy link

🚧 This issue or pull request has been closed due to not having had activity from an Istio team member since 2023-10-16. If you feel this issue or pull request deserves attention, please reopen the issue. Please see this wiki page for more information. Thank you for your contributions.

Created by the issue and PR lifecycle manager.

@manderson23
Copy link

manderson23 commented Apr 30, 2024

Should re-open as it looks like the earlier PRs referenced didn't include the initial stream and connection window sizes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking kind/enhancement lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while
Projects
None yet
Development

No branches or pull requests