-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: new event-based decisions log buffer implementation #7446
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
Conversation
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
61267a3 to
8d17daa
Compare
srenatus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, especially the numbers. I've gone through the code and commented a bit, adding a few questions for my understanding. I hope you don't mind 😃
srenatus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for bearing with me 😃
johanfylling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👍 😃
Some questions/comments.
To be continued ..
johanfylling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some additional notes.
Do we have some sort of comparative analysis on drop behavior between the two buffer types? E.g. is one buffer more prone to dropping events than the other while under the same pressure?
johanfylling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making good progress 😃
16e0278 to
fa26f44
Compare
This new event-based buffer provides a performance improvement over the exisiting buffer by reducing locks and allowing concurrent writes. Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
…opping of ND cache only happens when event is read from buffer. Signed-off-by: sspaink <[email protected]>
…o 10,000. Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
…lure. Signed-off-by: sspaink <[email protected]>
fa26f44 to
ef5b5c2
Compare
…multiple chunks. Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
…that is just used for a single log. Signed-off-by: sspaink <[email protected]>
…ure. Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
Signed-off-by: sspaink <[email protected]>
johanfylling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great 👍 .
Only two remaining concerns.
Signed-off-by: sspaink <[email protected]>
johanfylling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Thank you for bearing with me :)
|
142 comments (143 once I post this, I suppose) on a PR must be a new record for OPA! Amazing work @sspaink 👍 |

Why the changes in this PR are needed?
resolves: #5724
The existing buffer used by the decisions log plugin suffers from performance issues at a large scale. The heavy use of locks and when the events are compressed are the culprits for this slowdown.
What are the changes in this PR?
This PR introduces a new buffer implementation for the
Decisions Log Pluginwith the goal to improve performance.Two new configuration options are introduced:
decision_logs.reporting.buffer_type- toggle to use new buffer (labeled "event") and defaults to current implementation (labeled "size")decision_logs.reporting.buffer_size_limit_events- sets the number of events the buffer can hold, must be above zero and defaults to 100Simple performance comparison
The following setup was used for both the old and new buffer implementation:
example.rego:
Run the OPA server
Run a local server to consume logs (code runs a server and prints out decisions)
config
Results using the "event" buffer type
Results using the "size" buffer type:
Notes to assist PR review:
Please see the included README.md for a comparison between the current and this new buffer implementation.