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

[Feature] Kyverno Performance Optimizations #10231

Open
2 of 5 tasks
KhaledEmaraDev opened this issue May 13, 2024 · 0 comments
Open
2 of 5 tasks

[Feature] Kyverno Performance Optimizations #10231

KhaledEmaraDev opened this issue May 13, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request performance

Comments

@KhaledEmaraDev
Copy link
Collaborator

Problem Statement

Kyverno stands to gain from some performance optimizations. Currently when applying 2 mutate policies using Strategic Merge Patch we get the following performance:

avg=1.25s min=98.68ms med=996.53ms max=5.69s p(90)=2.6s p(95)=3.1s

After rewriting the policies to use JSON Patch:

avg=443.42ms min=96.83ms med=398.18ms max=1.1s p(90)=719.09ms p(95)=798.45ms

Also for validate in constrained resources scenarios we could improve a little. Using the profiler it seems that the two biggest offenders are:

  1. Memory Allocation and Garbage Collection
  2. Regex Used in:
    a. Variable and Reference substitution
    b. Anchor Processing

Also, time delay seems to grow linearly with the number of policies suggesting we could make use of parallelization.

Solution Description

For Validate we have three solutions:

For Mutate we already have our solution which is to use JSON Patch. However, other things should be considered like the user experience. Currently a non-issue as most Policy engines suffer from the same fate.

Finally we could parallelize policy application whether Mutate or Validate.

Alternatives

No response

Additional Context

No response

Slack discussion

No response

Research

  • I have read and followed the documentation AND the troubleshooting guide.
  • I have searched other issues in this repository and mine is not recorded.
@KhaledEmaraDev KhaledEmaraDev added enhancement New feature or request triage Default label assigned to all new issues indicating label curation is needed to fully organize. performance and removed triage Default label assigned to all new issues indicating label curation is needed to fully organize. labels May 13, 2024
@KhaledEmaraDev KhaledEmaraDev self-assigned this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

No branches or pull requests

1 participant