-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
perf: eliminate repeated route lookups in http filters #372
Comments
The return value here should be cached: https://github.com/lyft/envoy/blob/master/source/common/http/conn_manager_impl.h#L255 |
In thinking about this a little bit more it's not so simple, since the current interface takes the headers as a parameter, and the headers might potentially be modified between filters. Need to think a little more about this. |
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
Question is do filters want the route chosen by the http connection manager
or do they want to compute a route with custom headers ?
May be both depending on the scenario. But for majority of use cases, I can
see that folks will want to know which cluster or route was chosen by the
connection manager. That can certainly be cached right?
At the same time, if some filter wants to recompute the route by itself, it
can do so using the current way.
WDYT ?
On Fri, Jan 27, 2017 at 4:42 PM Matt Klein ***@***.***> wrote:
In thinking about this a little bit more it's not so simple, since the
current interface takes the headers as a parameter, and the headers might
potentially be modified between filters. Need to think a little more about
this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#372 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AH0qdwkvEyG2gk40cl-XHmJda_WFQhDfks5rWmTYgaJpZM4LrwRn>
.
--
~shriram
|
See the linked PR. In general, I agree that eventually we might want to allow a filter to lookup based on headers, but the reality is that nothing needs that right now. I would rather keep it simple into that requirement comes back. The attached PR simplifies things and is a lot faster in the common case. |
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
* ConfigManager downloads rollouts * Removed metadata overriding, separated timer function * Fixed current_rollout_id update bug * Separated OnRolloutResponse * Added test case for same rollout_id * Added test case for same rollout_id * Fixed formatting * Moved rollout_apply_function from Init() to Constructor
zh-translation:docs/root/configuration/other_protocols/other_protocol…
This updates our static framework rule to properly copy the `-Swift.h` header file from the bazel output directory into our final `Envoy.framework/Headers/Envoy-Swift.h`. There are a few workarounds here for issues that @kastiglione has been nice enough to file upstream: **bazelbuild/rules_swift#291 The code required to find and copy the `-Swift.h` header file could be simplified with this issue. **bazelbuild/rules_apple#557 From the Objective-C demo app, we also depend on an empty Swift library to force dependencies like `swiftFoundation` to link. Resolves envoyproxy/envoy-mobile#230 Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
This updates our static framework rule to properly copy the `-Swift.h` header file from the bazel output directory into our final `Envoy.framework/Headers/Envoy-Swift.h`. There are a few workarounds here for issues that @kastiglione has been nice enough to file upstream: **bazelbuild/rules_swift#291 The code required to find and copy the `-Swift.h` header file could be simplified with this issue. **bazelbuild/rules_apple#557 From the Objective-C demo app, we also depend on an empty Swift library to force dependencies like `swiftFoundation` to link. Resolves envoyproxy/envoy-mobile#230 Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
The rate limit filter and the fault filter can be applied to specific upstream clusters. Currently, these filters recompute the route on their own. For performance reasons, this recomputation should be avoided. Instead, the upstream cluster chosen by the http connection manager should be made available via the some accessible interface.
The text was updated successfully, but these errors were encountered: