-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement Garbage Collection #2022
Conversation
ce7c41f
to
c731ddf
Compare
b37efc9
to
a4bffb2
Compare
Note: I needed to refactor the pinning code in order to share code with some GC functionality. The functionality hasn't changed, things have just moved around somewhat. |
@dirkmc thanks for working on this, and looking forward to the finish line. We're using JS-IPFS to run 24/7 video streams in the browser; it is fairly quickly filling up all available disk. Please let me know if there's anything I can do to assist. |
@wehriam that's great to hear, thanks! It would be great to get some feedback from some different use cases. Would you like to try out this branch to see if it helps with your use case? I can provide instructions if you're not sure how |
@dirkmc thanks! We did a build off of feat/gc and are testing it now. It seems to be working well so far. Are you planning support for Datastore options similar to those in go-ipfs? They aren't in the config parser so I wasn't sure. We're currently using the navigator.storage.estimate() method (when available) to determine when to trigger GC. Are all unpinned blocks removed on GC? It would be great to have a way to remove them on an LRU basis so browser-based swarms could serve as an edge cache for large files. |
@wehriam the implementation of GC on this branch must be manually invoked, and removes all blocks that are unpinned and not in MFS. We are currently discussing how best to implement automatic GC, including using an LRU heuristic. You can see usage information for the IPFS repo with |
@dirkmc I have a fiddle running here - https://jsfiddle.net/t9a5ogc1/ - you can see usage stats in the console. |
This works well in our testing. Are there any blockers for a final release? It appears ipfs-inactive/interface-js-ipfs-core#460 has been successfully merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a real quick first pass review - I'll circle back to this and do a proper review asap.
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
Port of #2372 into gc branch to ease merging
resolves #2012
Depends on
TODO: