Git Product home page Git Product logo

Comments (10)

ashutosh-narkar avatar ashutosh-narkar commented on June 18, 2024

Thanks for the detailed issue @itayhac. I tried to reproduce this by running OPA on docker and setting a 4GB memory limit. I increased the number of go routines from your script to send more concurrent requests to OPA. The maximum amount of memory consumed by OPA did not cross 200 MB. Is there something different in your actual setup vs the mock bundle you've provided here? I would expect the CPU usage to spike while OPA handles these requests but it's still unclear why OPA runs OOM.

from opa.

itayhac avatar itayhac commented on June 18, 2024

Hi @ashutosh-narkar , thank you so much for you fast and detailed reply.
i changed the files to reproduce the issue with 4GB memory (i increased the size and structure of the data.json file).

please retry and it should be reproduced.

from opa.

ashutosh-narkar avatar ashutosh-narkar commented on June 18, 2024

One thing I noticed in the policy is you're using the object.get builtin on the data set instead of just accessing under data.rules for example. You can probably avoid using the builtin. Another thing I noticed when I run the stress test with the openpolicyagent/opa:0.64.1-static image variant there is no significant increase in memory. Have you seen that as well?

from opa.

itayhac avatar itayhac commented on June 18, 2024

any further thoughts?
@ashutosh-narkar can we label it as bug and prioritize it?

from opa.

ashutosh-narkar avatar ashutosh-narkar commented on June 18, 2024

@itayhac can you please confirm if you're able to repro this issue with the upstream OPA images including any differences with the static variant. You mentioned (in a separate thread) that y'all are building your own images. Also this could be a relevant issue.

from opa.

itayhac avatar itayhac commented on June 18, 2024

the problem is reproduced with our own OPA image (we compile latest), and with both latest public images (static and non-static)

from opa.

ashutosh-narkar avatar ashutosh-narkar commented on June 18, 2024

This could be related to #5946. In your policy you're referring to a large object and this can be replicated if you modify the policy to refer to the object w/o using the object.get builtin. @johanfylling did you encounter something like this while working on #6040 ?

from opa.

johanfylling avatar johanfylling commented on June 18, 2024

@ashutosh-narkar, the work in #6040 focused solely on the CPU time aspect, and did not look at how memory usage was affected.

from opa.

ashutosh-narkar avatar ashutosh-narkar commented on June 18, 2024

The data has some objects and arrays and I wonder if when referenced inside of the policy the interface-AST conversions are impacting performance in terms of CPU and memory.

from opa.

ashutosh-narkar avatar ashutosh-narkar commented on June 18, 2024

We're looking to implement something like discussed in #4147. This should probably help with performance as we'll avoid the interface to AST conversion during eval.

from opa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.