Improve IPFS memory usage #52
Closed
opened 2019-05-01 12:03:22 +00:00 by raucao
·
12 comments
No Branch/Tag Specified
Labels
Clear labels
monitoring
bug
design
dev environment
docs
duplicate
enhancement
feature
good first issue
idea
invalid
kredits-1
kredits-2
kredits-3
on hold
ops
question
security
ui/ux
wontfix
service
discourse
Kosmos Community Forums
Infrastructure metrics, alerts, notifications, etc.
service
accounts
Kosmos Accounts
service
drone-ci
Kosmos Drone CI
service
email
mail.kosmos.org
service
garage
S3-compatible object storage
service
gitea
Kosmos Gitea
service
ipfs
Kosmos IPFS
service
lightning
Lightning address, lndhub, etc.
service
mastodon
kosmos.social
service
nostr
Relays, Blossom server, etc.
service
postgres
Database cluster
service
remotestorage
Portable data storage for the Web
service
wiki
Kosmos Wiki
service
xmpp
Kosmos Chat
Something is not working
Graphic/visual design
Config, builds, CI, deployment, etc.
Documentation
This issue or pull request already exists
Improving existing functionality
New functionality
Dive in, and start contributing
Something to consider
Not a bug
Small contribution
Medium contribution
Large contribution
Currently not actionable
Manual IT ops activities
Looking for an answer
release
major
release
minor
release
patch
All your base are belong to us
User interface, process design, etc.
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kosmos/chef#52
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I found some hints for reducing memory usage in these GitHub comments:
IPFS memory usageto Improve IPFS memory usageBy the way, the config contains lots of settings that we most likely want to change for the small DO boxes that are supposed to mostly keep our own data replicated. E.g. minimum and maximum number of peer connections: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#basic-connection-manager
Cool, giving these a try manually on barnard
I tried all of these and the memory usage was still getting up to 1GB in only a few minutes. I have tried something else: removing all the bootstrap nodes from the config. After this change, the ipfs process is using ~150MB after 30 minutes, let's see how this evolves.
I think every ipfs node needs to have the other members of the cluster as bootstrap nodes in case they don't have 100% uptime. If the cluster is up they get all the pins, but if the cluster daemon is down while a document is created they wouldn't be able to load the document
How does that make sense, when we create documents through the cluster node's API instead of the IPFS daemon one? Doesn't that mean you cannot create docs when the cluster process is down?
No, I'm just saying if you're not connected to the cluster when the document is created, you wouldn't be able to get the document after the fact (if you're not connected to any of our nodes that have the document)
Update: even removing all bootstrap nodes from the config doesn't help with the ridiculous memory consumption. After 4 hours the ipfs daemon on barnard is using 625M of RAM
I don't understand what this means. Who is "you" in this case? And why wouldn't one be able to get a document, when it's available on the IPFS network in general?
There's a WIP PR for ipfs-go that's supposed to fix the memory leaks caused by storing the peerstore in memory: https://github.com/ipfs/go-ipfs/pull/6080
On barnard go-ipfs is now using 716M of RAM after 15 hours
Yeah I got confused, even without bootstrap nodes it's still connecting to the network
In the meantime we can use Systemd's MemoryHigh and MemoryMax to keep the memory usage of go-ipfs under control: https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html#MemoryHigh=bytes
Testing it on barnard
We have significantly lowered memory usage on barnard (by lowering the min and max number of connections, disabling bandwidth metrics). The daemon is using 80MB of RAM after 40 minutes on barnard.
The master branch of our chef repo now uses this WIP PR in the ipfs-cookbook repo: https://github.com/67P/ipfs-cookbook/pull/4 (I need to make the attributes configurable, but first we're continuing the migration)
We forgot to close this one. We merged https://github.com/67P/ipfs-cookbook/pull/4
No PR since the change were done to an external cookbook, so I'm adding a label and @raucao and I as assignees to this issue