Skip to content

OPA is CPU inefficient #7438

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

Closed
ammario opened this issue May 5, 2023 · 4 comments · Fixed by #7439
Closed

OPA is CPU inefficient #7438

ammario opened this issue May 5, 2023 · 4 comments · Fixed by #7439

Comments

@ammario
Copy link
Member

ammario commented May 5, 2023

Looking at CPU usage on dogfood, OPA "topdown" takes 48% of our CPU. While agent metadata created ~5 rps per active workspace, and we should move reporting to a websocket, RBAC is consuming an excessive amount of CPU for the functionality we're getting.

profile.pb.gz

cc @Emyrk @coadler @kylecarbs

@ammario ammario added the bug label May 5, 2023
@ammario ammario linked a pull request May 5, 2023 that will close this issue
@Emyrk
Copy link
Member

Emyrk commented May 7, 2023

Yea, this has been an issue. Your global cache is a good solution.

I spent a lot of time on OPA trying to reduce things, and have found about 1ms per request is what we could reasonably expect. Even if our policy was just a "return true".

@ammario
Copy link
Member Author

ammario commented May 7, 2023

Gotcha. @kylecarbs is investigating a SQL-oriented approach since the needs of our system is pretty basic right now. We might as well merge #7439 as the work is done though.

@Emyrk
Copy link
Member

Emyrk commented May 8, 2023

Gotcha. @kylecarbs is investigating a SQL-oriented approach since the needs of our system is pretty basic right now. We might as well merge #7439 as the work is done though.

SQL RBAC solution? If so, that would make integrating into the data model easier for sure.

@kylecarbs
Copy link
Member

@Emyrk we should sync on some ideas here. I'll ping you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants