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

Envoy memory optimization: do better filter_chain_match organization #1636

Open
phylake opened this issue Oct 4, 2019 · 5 comments
Open

Comments

@phylake
Copy link

phylake commented Oct 4, 2019

Contour creates a filter_chain_match with a single FQDN in server_names for every FQDN. It also provides TLS delegation which we use heavily. The problem is that the same tls_context and filters are copied in each filter_chain.

We reorganized filter_chain_match creation to aggregate server_names that reference the same secret name and saw a memory reduction of 40+ GiB to ~250 MiB in Envoy

This non-optimal construction of filter_chain_match plus #1635 plus envoyproxy/envoy#7923 came together to cause our months-long issue of Envoy being oom-killed

@phylake
Copy link
Author

phylake commented Oct 4, 2019

Forgot to mention: you might think it's better to aggregate FQDNs by cert content (i.e. a digest), or inspect the cert and aggregate by Common Name. The latter was our first approach but it was confounded by envoyproxy/envoy#6767

@dharmab
Copy link

dharmab commented Oct 4, 2019

aggregate by Common Name

What about Subject Alternative Names? That aggregation could get tricky.

@dharmab
Copy link

dharmab commented Oct 4, 2019

There's also a corner case for different certs issued for the same names by different PKIs (think internal/enterprise CAs).

@davecheney
Copy link
Contributor

davecheney commented Oct 4, 2019 via email

@davecheney davecheney added this to the Backlog milestone Nov 17, 2019
@jpeach
Copy link
Contributor

jpeach commented Apr 29, 2020

FYI, we organized the filter chains differently in 1.4 to enforce SNI binding semantics. This strongly binds a SNI server name to the corresponding routes, but I expect that this has some negative effect on Envoy resources, since there are now more HttpConnectionManagers.

@skriss skriss removed this from the Backlog milestone Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Contour Project Board
  
Unprioritized
Development

No branches or pull requests

5 participants