Fix performance bug in L7 policy proxy redirect handling#44613
Merged
Fix performance bug in L7 policy proxy redirect handling#44613
Conversation
This commit configures custom exponential histogram buckets for endpoint regeneration and policy implementation delay metrics. Currently, the histogram bucket for these metrics is capped at 10s. This leads to incorrect interpretation of data in high scale environment where in some cases we have seen the operations to take more than a minute. With this change the metrics are configured with exponential bucket starting from 1us with a step of 10 upto 100s. Signed-off-by: Deepesh Pathak <deepeshpathak09@gmail.com>
This commit fixes a performance bug in cilium-agent endpoint policy regeneration handling. Currently for each endpoint proxy redirect(loosely corresponds to L7 dependent L4 elements in policy), we loop through all existing redirects to account for total count. This leads to a O(n^2) complexity loop during policy proxy configuration. In clusters with large scale l7 policies this causes huge delays for endpoint policy regeneration. This commit fixes the issue by keeping a running total count of proxy redirects making the overall operation O(n). In some cases this improves endpoint regeneration time by 10x. Signed-off-by: Deepesh Pathak <deepeshpathak09@gmail.com>
Member
Author
|
/test |
jrajahalme
approved these changes
Mar 4, 2026
Member
|
This is compounded by the fact that |
chancez
approved these changes
Mar 4, 2026
4 tasks
10 tasks
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.
Sample result from testing with(cl2 module coming soon):
Before:

After:

See commit message for details.