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

Optimize per_route config pre-processing for filters. #3008

Closed
qiwzhang opened this issue Apr 5, 2018 · 1 comment
Closed

Optimize per_route config pre-processing for filters. #3008

qiwzhang opened this issue Apr 5, 2018 · 1 comment
Labels
enhancement Feature requests. Not bugs or questions. help wanted Needs help!

Comments

@qiwzhang
Copy link
Contributor

qiwzhang commented Apr 5, 2018

Description:

This is referring to the new per_route_config added in envoyproxy/data-plane-api#605 (comment)

Specifically to optimize the pre-processing of per-route config. Here is the proposal

like to clarify how per_route_config_sha can be used.

A filter needs to preprocess the per_route_config.

obj = pre_process(pre_route_config);

Such pre-processing can be slow, it should NOT be performed for each request. One way to optimize it is to save the preprocessed "obj" in some global config. When a request comes, the filter just needs to detect if per_route_config has been changed. Without "sha" map, the filter needs to serialize the proto and sha it to detect the config change. If per-route config is big, these two steps can be slow too.

Another option is to add a new function in FilterFactory

void setRouteConfig(string unique_route_id, Struct config) PURE;

This function will be called when RDS receives new route tables, This will give filter chance to preprocess per_route config and save the pre-processed obj into its global map (not pre-request).

as global_map[ route_id ] = obj;

During request, obj can be retrieved as

obj = global_map[ filter_callback->route()->unique_route_id() ];

This is better than first approach, the pre-process is done in the config thread, not at worker thread.

Agreed that, such optimization can be done in the later phase.

@qiwzhang qiwzhang changed the title Optimize per_route config pre-p;rocessing for filters. Optimize per_route config pre-processing for filters. Apr 5, 2018
@mattklein123 mattklein123 added enhancement Feature requests. Not bugs or questions. help wanted Needs help! labels Apr 5, 2018
@rshriram
Copy link
Member

@mattklein123 we can close this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests. Not bugs or questions. help wanted Needs help!
Projects
None yet
Development

No branches or pull requests

3 participants