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

cnquery sbom local takes up all memory on smaller instance #3922

Open
stumyp opened this issue May 3, 2024 · 2 comments
Open

cnquery sbom local takes up all memory on smaller instance #3922

stumyp opened this issue May 3, 2024 · 2 comments

Comments

@stumyp
Copy link

stumyp commented May 3, 2024

Describe the bug

When I run cnquery sbom local for the first time on the t3.micro instance it completely overwhelms it and takes up all memory.

After SIGTERM/Ctrl-C it eventually stops and subsequent run works very quickly

To Reproduce
Steps to reproduce the behavior:

  1. Boot up fresh Ubuntu server
  2. bash -c "$(curl -sSL https://install.mondoo.com/sh)"
  3. export MONDOO_CONFIG_BASE64=xxx
  4. cnquery status (successful)
  5. cnquery sbom local - hangs

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots or CLI Output

root@ip-10-0-6-49:~# cnquery status
! can't find any paths for providers, none are configured system-path=/opt/mondoo/providers
→ loaded configuration from environment using source $MONDOO_CONFIG_BASE64
→ Platform:		ubuntu
→ Version:		22.04
→ Hostname:		ip-10-0-6-49.ec2.internal
→ IP:			10.0.6.49
→ Time:			2024-05-03T22:14:22Z
→ Version:		11.2.0 (API Version: 11)
→ Latest Version:	11.2.0
→ Installed Providers:	mock | core
→ API ConnectionConfig:	https://us.api.mondoo.com
→ API Status:		SERVING
→ API Time:		2024-05-03T22:14:22Z
→ API Version:		11
→ Owner:		//captain.api.mondoo.app/spaces/xxx
→ Client:		no managed client
→ Service Account:		//agents.api.mondoo.app/spaces/xxx
→ client is registered
→ client authenticated successfully
root@ip-10-0-6-49:~# cnquery sbom local
! can't find any paths for providers, none are configured system-path=/opt/mondoo/providers
→ installing provider 'os' version=11.1.0
→ successfully installed os provider path=/opt/mondoo/providers/os version=11.1.0
→ This command is experimental. Please report any issues to https://github.com/mondoohq/cnquery.
→ loaded configuration from environment using source $MONDOO_CONFIG_BASE64
→ using service account credentials
→ discover related assets for 1 asset(s)

 i-xxx ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%

top output:

top - 22:15:06 up 12 min,  4 users,  load average: 1.29, 0.37, 0.12
Tasks: 114 total,   1 running, 113 sleeping,   0 stopped,   0 zombie
%Cpu0  : 42.3 us, 19.5 sy,  0.0 ni, 25.6 id,  0.7 wa,  0.0 hi,  0.0 si, 11.9 st
%Cpu1  : 43.6 us, 19.0 sy,  0.0 ni, 24.9 id,  0.3 wa,  0.0 hi,  0.0 si, 12.1 st
MiB Mem :    904.9 total,     64.2 free,    708.7 used,    132.0 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.     47.1 avail Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
   1675 root      20   0 1559.6m 384.6m  11.2m S  82.1  42.5   0:24.87 cnquery sbom local
   1680 root      20   0 1318.1m  89.0m  12.5m S  61.8   9.8   0:18.87 /opt/mondoo/providers/os/os run_as_plugin --log-level info

Desktop (please complete the following information):

  • OS: Ubuntu
  • OS Version: 22.04
  • Browser if applicable: NA
  • Browser Version: NA
@scottford-io
Copy link
Contributor

@chris-rock Have you seen this before?

@chris-rock
Copy link
Member

That is caused by the collection of the files associated with the packages. We will make this optional then the amount of data required is way less and it is also much faster.

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

No branches or pull requests

3 participants