ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.03k stars 3k forks source link

Repo Size Constraints #972

Open jbenet opened 9 years ago

jbenet commented 9 years ago

It is a common problem already that the space of go-ipfs grows unbounded. We want to have the ability to limit the growth.


Complicating factors:


I've been thinking of a setup with two thresholds:

cryptix commented 9 years ago

A threshold triggering repo gc sgtm. I'd be interested in ratio stats of pinned vs unpinned objects in general.

jbenet commented 9 years ago

From #1482, i think we should have one global maximum storage, and trigger GC when we past a watermark (say max - 1/5MB close). ideally we could also configure the GC watermark to bring it lower.

rht commented 9 years ago

node.repo.datastore.storage_gc_watermark ~ hard limit on pin size? Otherwise even GC after commands won't bring down the repo size.

rht commented 9 years ago

How about swapping the hard limit role? Instead of storage_gc_watermark + storage_max (hard limit), use pin_max (hard limit) + blurriness? blurriness/standard_dev/swappiness is like the amount of bluriness between local storage and peer storage. Default value is 100 (100% of pin_max). By now, the only concern for global size cap other than blockstore is leveldb store size.

Also, where to put the trigger check?

  1. every 100 GetBlocks cycle
  2. every 10 mins
  3. every time a command is run