Skip to content

[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
istio-testing:cherry-pick-41101-to-release-1.15
Closed

[release-1.15] avoid unnecessary copy virtual services for sidecar scope calculation#42671
istio-testing wants to merge 1 commit intoistio:release-1.15from
istio-testing:cherry-pick-41101-to-release-1.15

Conversation

@istio-testing
Copy link
Copy Markdown
Collaborator

This is an automated cherry-pick of #41101

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>
@istio-testing istio-testing requested a review from a team January 4, 2023 21:57
@istio-testing istio-testing added release-notes-none Indicates a PR that does not require release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 4, 2023
@dhawton
Copy link
Copy Markdown
Member

dhawton commented Jan 4, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes-none Indicates a PR that does not require release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants