Audit performance #112
Replies: 2 comments 2 replies
-
There could be CPU overhead associated with the additional memory management and handling of watches or possibly swapping depending on how the memory is set up. Rego needing to take longer to traverse the data tree could be possible, though hopefully OPA isn't affected by un-traversed data paths. Memory and CPU usage is expected to be reduced in the near future, once we have finished implementing compiler sharding: |
Beta Was this translation helpful? Give feedback.
-
Thanks for raising this @shin-nien! What version of gatekeeper are you using? If you are on v3.7.0+, PTAL
https://open-policy-agent.github.io/gatekeeper/website/docs//gatekeeper/website/docs/audit I noticed it’s currently set to: --audit-chunk-size=0 Another thing is since you are not using audit from cache, you do not need to sync all the objects to OPA unless you need it for data.inventory in the rego to test things like uniqueness. Sync objects to OPA can increase the memory footprint of gatekeeper. Depending on the number of resources in the cluster you need to sync, you will need to adjust the memory limits given to the audit pod to prevent OOMKilled. |
Beta Was this translation helpful? Give feedback.
-
Posting a bit of fyi of our experience and I'm trying to find out a bit more about how Audit works for capacity planning reasons.
Our current Kubernetes setup:
With these settings we get reasonable audit times of ~60 minutes. CPU is ~1.75 cores and <1Gi of memory.
But with a bigger config we started to see issues:
We observed that if we added more resources to
syncOnly
then Audit's healthchecks would start to fail intermittently and seemed to be affecting audit overall e.g. you stop seeing violations appear in the logs until much later. We don't have constraints/policies that rely ondata.inventory
yet so we didn't think there's any reason why adding more to the internal cache would cause Audit issues. Can anyone explain why a difference in sync config would make a difference?Beta Was this translation helpful? Give feedback.
All reactions