Skip to content

Fix: IPFS Kubo could use unlimited resources #768

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
wants to merge 3 commits into from

Conversation

hoh
Copy link
Member

@hoh hoh commented Feb 27, 2025

In observations on multiple CRNs and CCNs,
it seems to use around 700-900 MB.

Limiting the resources to 2GB and hard to 4GB
seems therefore sensible.

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.26%. Comparing base (f09bdd2) to head (14c4c6c).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #768   +/-   ##
=======================================
  Coverage   63.26%   63.26%           
=======================================
  Files          77       77           
  Lines        6855     6855           
  Branches      576      576           
=======================================
  Hits         4337     4337           
  Misses       2329     2329           
  Partials      189      189           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hoh hoh force-pushed the hoh-limit-ipfs-kubo-resources branch from 8866394 to d9cd8ff Compare February 27, 2025 16:04
Copy link
Collaborator

@Psycojoker Psycojoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olethanh
Copy link
Collaborator

According to the Kubo doc we should also set GOMEMLIMIT env var to avoid having it OOM killed

To set memory limit for the entire Kubo process, use GOMEMLIMIT environment variable which all Go programs recognize, and then set Swarm.ResourceMgr.MaxMemory to less than your custom GOMEMLIMIT.

@olethanh
Copy link
Collaborator

forgot link to Kubo doc here : https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgrmaxmemory

Will add the modification

@olethanh olethanh force-pushed the hoh-limit-ipfs-kubo-resources branch from 9bb47ce to 1e8a93d Compare February 28, 2025 10:55
@hoh
Copy link
Member Author

hoh commented Mar 3, 2025

CI failed due to:

docker: Error response from daemon: toomanyrequests: You have reached your unauthenticated pull rate limit. https://www.docker.com/increase-rate-limit.

hoh and others added 2 commits March 3, 2025 11:47
In observations on multiple CRNs and CCNs,
it seems to use around 700-900 MB.

Limiting the resources to 2GB and hard to 4GB
seems therefore sensible.
@hoh hoh force-pushed the hoh-limit-ipfs-kubo-resources branch from 1e8a93d to b08df08 Compare March 3, 2025 10:47
@olethanh
Copy link
Collaborator

olethanh commented Mar 3, 2025

failing because of


Job for ipfs.service failed because the control process exited with error code.

See "systemctl status ipfs.service" and "journalctl -xeu ipfs.service" for details.

dpkg: error processing package aleph-vm (--configure):
 installed aleph-vm package post-installation script subprocess returned error exit status 1
Setting up gstreamer1.0-libav:amd64 (1.22.0-2) ...
Setting up qemu-system-gui (1:7.2+dfsg-7+deb12u12) ...
Processing triggers for libc-bin (2.36-9+deb12u9) ...
Processing triggers for libgdk-pixbuf-2.0-0:amd64 (2.42.10+dfsg-1+deb12u1) ...
Errors were encountered while processing:
 aleph-vm
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

@hoh
Copy link
Member Author

hoh commented Mar 18, 2025

This approach does not work with recent versions of Kubo, see https://github.com/aleph-im/aleph-vm/pull/779/files where we use systemd ExecStartPre for that purpose.

@hoh
Copy link
Member Author

hoh commented Mar 19, 2025

Moved into #779

@hoh hoh closed this Mar 19, 2025
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 this pull request may close these issues.

4 participants