perf: cache HTTP route when looked up by filters#389
Merged
mattklein123 merged 4 commits intomasterfrom Jan 30, 2017
Merged
Conversation
If multiple filters consult the route table, the same route can be looked up many times. With large route tables, this can become quite expensive. This change adds caching for the route lookup and changes the interfaces so that headers are no longer passed when getting a stable route. In the future we may need to add route cache clearing, but for now this is fine. fixes #372
Member
Author
|
@lyft/network-team @rshriram |
rshriram
reviewed
Jan 28, 2017
| } | ||
|
|
||
| bool FaultFilter::matchesTargetCluster(const HeaderMap& headers) { | ||
| bool FaultFilter::matchesTargetCluster(const HeaderMap&) { |
Member
There was a problem hiding this comment.
You could get rid of the headers arg completely. It's used only to obtain the target cluster from connection manager.
junr03
reviewed
Jan 28, 2017
include/envoy/http/filter.h
Outdated
| * Returns the route for the current request. The assumption is that the implementation can do | ||
| * caching where applicable to avoid multiple lookups. | ||
| * | ||
| * NOTE: This breaks down a bit if the caller knows it has modified something that would effect |
junr03
reviewed
Jan 28, 2017
include/envoy/http/filter.h
Outdated
| * NOTE: This breaks down a bit if the caller knows it has modified something that would effect | ||
| * routing (such as the request headers). In practice, we don't do this anywhere currently, | ||
| * but in the future we might need to provide the ability to clear the cache if a filter | ||
| * knows that it has modified the headers in a way that would effect routing. In the future |
RomanDzhabarov
approved these changes
Jan 30, 2017
Member
RomanDzhabarov
left a comment
There was a problem hiding this comment.
LGTM, also we'd need to invalidate that cache when we have RDS in place.
Member
Author
|
RDS does not require cache invalidation in and of itself, as the caching is per request, not global. |
mattklein123
added a commit
that referenced
this pull request
Feb 9, 2017
#389 did not actually cache them between filters which was the point of the previous change.
mattklein123
added a commit
that referenced
this pull request
Feb 9, 2017
#389 did not actually cache them between filters which was the point of the previous change.
rshriram
pushed a commit
to rshriram/envoy
that referenced
this pull request
Oct 30, 2018
rshriram
pushed a commit
to rshriram/envoy
that referenced
this pull request
Oct 30, 2018
jpsim
pushed a commit
that referenced
this pull request
Nov 28, 2022
Signed-off-by: Alan Chiu <achiu@lyft.com> For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md) Description: docs: add some intellij instructions Risk Level: low Testing: local Docs Changes: tools Release Notes: n/a [Optional Fixes #Issue] [Optional Deprecated:] Signed-off-by: JP Simard <jp@jpsim.com>
jpsim
pushed a commit
that referenced
this pull request
Nov 29, 2022
Signed-off-by: Alan Chiu <achiu@lyft.com> For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md) Description: docs: add some intellij instructions Risk Level: low Testing: local Docs Changes: tools Release Notes: n/a [Optional Fixes #Issue] [Optional Deprecated:] Signed-off-by: JP Simard <jp@jpsim.com>
mathetake
added a commit
that referenced
this pull request
Mar 3, 2026
**Commit Message** At the first iteration of the "getting started guide", I added `--fail` in all commands as we had an automated testing of the site documentation and it allowed us to detect if the curl command not is working. However, now we don't have any tests like that + `--fail` prevents users from seeing the actual error response from the upstream which makes it difficult to troubleshoot since it suppresses the response body due to the early cancel of requests. **Related Issues/PRs (if applicable)** The root cause of #379 #375 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If multiple filters consult the route table, the same route can be looked
up many times. With large route tables, this can become quite expensive.
This change adds caching for the route lookup and changes the interfaces
so that headers are no longer passed when getting a stable route. In
the future we may need to add route cache clearing, but for now this is
fine.
fixes #372