[release-1.15] avoid unnecessary copy virtual services for sidecar scope calculation#42671
Closed
istio-testing wants to merge 1 commit intoistio:release-1.15from
Closed
Conversation
After DeepCopy improvements, init context time takes roughly 39s, and more than 20% of cpu time is spent on the VirtualServicesForGateway function: https://github.com/istio/istio/blob/1.14.4/pilot/pkg/model/push_context.go#L863-L875 This function is called for every sidecar's egress host, for calculating the virtual services that are imported by the egress host. We have more than 10k sidecars and suppose each sidecar has 10 egress hosts, this function is called 100k times. What makes it worse is that all our virtual services are public (exportTo: *), so VirtualServicesForGateway creates and copies all virtual services (roughly also more than 10k) each time. This "make slice" and "slice copy" are expansive on such magnitude. This CL gets rid of such copy, instead of passing in the copied and merged version of the virtual services, just pass the virtualServiceIndex into the select function directly. This improves the init context time to roughly 25s. Change-Id: I48015e750a1019f12dfc35b0ca42b72fddfa87ba Reviewed-on: https://gerrit.musta.ch/c/public/istio/+/3745 Reviewed-by: Jungho Ahn <jungho.ahn@airbnb.com> Reviewed-by: Weibo He <weibo.he@airbnb.com>
12 tasks
Member
|
Istio has a cherry-picking policy that only bug fixes and CVE fixes can be cherry-picked. This PR does not appear to meet that criteria. |
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.
This is an automated cherry-pick of #41101