Understanding the definition of ONE rule in Rego #629
Unanswered
Dove-tech
asked this question in
OPA and Rego
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I am new to using OPA and I have a question about how to define ONE "rule" in Rego. In the Performance section of the documentation, it mentions:
"Memory usage also scales linearly with the number of rules loaded into OPA. For example, loading 10,000 rules that implement an ACL-style authorization policy consumes approximately 130MB of RAM while 100,000 rules implementing the same policy (but with 10x more tuples to check) consumes approximately 1.1GB of RAM."
Here, what exactly does "10,000 rules" mean? Does this refer to loading 10,000 separate Rego files, or can one Rego file contain multiple rules?
Additionally, the documentation states:
"When OPA evaluates a rule, we say OPA generates the content of the document that is defined by the rule."
If a Rego file computes several variables such as allow, deny, etc., does this count as multiple rules?
Furthermore, I would like to know the specific impact of the number of rules on performance. Is there any way to see how much memory is used when evaluating these rules? Currently, it seems that the official OPA documentation only provides methods to check the runtime, but not other host resource usages.
Thank you very much for your help!
Beta Was this translation helpful? Give feedback.
All reactions