-
Notifications
You must be signed in to change notification settings - Fork 11
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
High CPU usage during REPL debug for large input file #229
Comments
@princespaghetti Thanks for reporting! That's interesting, but it's not entirely impossible to happen if you have accidentally quadratic code in a rule -- this happened to us a bunch of times as well. Most of the time the rule can be refactored to fix that. Were you able to run the rule in reasonable time using the vanilla Open Policy Agent? Any chance you could get us some more information, e.g. which rule may be the culprit, or what the approximate amount of resources in the tf-plan file is? |
Hey, |
Okay, this indicates what the problem is. When you're debugging, However, disabling these optimizations can cause huge regressions, since a lot of rules will need to be recomputed all the time. I'll see if we can add a way to leave them on during debugging, maybe with additional messages when caching causes a jump. |
This will enable the optimizations even when debugging: see #229.
This will enable the optimizations even when debugging: see #229.
Versions tested with: 0.11.1/0.12
While using fregot with a a custom set of rules and leveraging the regula library, the execution hangs while invoking the main deny. I let it run for 10 mins or so and it keep pretty high CPU usage the whole time.
Steps to recreate:
fregot repl --input tf-plan.json policy
:break data.rule.<rulename>.<etc>
data.main.deny
This seems to be due to a large tf-plan file (1.1 MB). Smaller files seem to work fine with the same library of rules.
The text was updated successfully, but these errors were encountered: