Skip to content
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 memory consumption #173

Open
mgappa opened this issue May 21, 2024 · 2 comments
Open

High memory consumption #173

mgappa opened this issue May 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mgappa
Copy link

mgappa commented May 21, 2024

Describe the bug

When we extract a large number of hosts or vulnerabilities, we see a large memory consumption.

Expected behavior

The memory consumption must be constant and predictable during the data recovery.

Current behavior

Since we have a huge and increasing number of instances, the memory consumption increases to the point of reaching more than 10Go of RAM memory.
Type of error we have from AWS step function :

{
  "errorType": "Runtime.ExitError",
  "errorMessage": "RequestId: XXXX Error: Runtime exited with error: signal: killed"
}

Possible solution

During our investigation, we have concluded the function execute is the root cause of the consumption. One way to solve this is to create a generator instead of a list that increases in size at each loop.

Steps to reproduce

  1. Have more than 6000 hosts onboarded on primsa with vulnerabilities.
  2. Run a script on an environment with a memory size limited to 4 Go.
  3. Constat the crash at one point, with a MemoryError or an ExitError

Context

In our enterprise context, we want to create a useful dashboard to animate our team around vulnerabilities and patch these vulnerabilities.

Your Environment

  • Version used: The latest eu SaaS version
  • Environment name and version: Container image on python:3.11.6-slim-bullseye with prismacloud-api==5.2.8 and aws-lambda-powertools==2.26.0
@mgappa mgappa added the bug Something isn't working label May 21, 2024
@mgappa
Copy link
Author

mgappa commented May 21, 2024

I would like to propose a PR for this bug

@SimOnPanw
Copy link
Collaborator

@mgappa happy to review your PR when submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants