We need a number of configurable resource limits. This issue will serve as a meta-issue to track them all and discuss a consistent way to configure/handle them.
I'm going to use a notation like thingA.subthingB.subthingC. we dont have to keep this at all, just helps us bind scoped names to things. (using . instead of / as the . could reflect json hierarchy in the config, but it may not have to (e.g. repo.storage_max and repo.datastore.storage_gc_watermark could be in config as Repo.StorageMax and Repo.StorageGC, or something.).
Possible Limits
This is a list of possible limits. I don't think we need all of them, as other tools could limit this more, particularly in server scenarios. but please keep in mind that some users/use cases of ipfs demand that we have some limits in place ourselves, as many end users cannot be expected to even know what a Terminal is (e.g. if they run ipfs as an elecron-app or as a browser extension).
note on config: the above keys need not be the config keys, but we should figure out some keys that make sense hierarchically.
What other things are we interested in limiting?
We need a number of configurable resource limits. This issue will serve as a meta-issue to track them all and discuss a consistent way to configure/handle them.
I'm going to use a notation like
thingA.subthingB.subthingC. we dont have to keep this at all, just helps us bind scoped names to things. (using.instead of/as the.could reflect json hierarchy in the config, but it may not have to (e.g.repo.storage_maxandrepo.datastore.storage_gc_watermarkcould be in config asRepo.StorageMaxandRepo.StorageGC, or something.).Possible Limits
This is a list of possible limits. I don't think we need all of them, as other tools could limit this more, particularly in server scenarios. but please keep in mind that some users/use cases of ipfs demand that we have some limits in place ourselves, as many end users cannot be expected to even know what a Terminal is (e.g. if they run ipfs as an elecron-app or as a browser extension).
node.repo.storage_max: this affects the physical storage that a repo takes up. this must include all the storage, datastore + config file size (ok to pre-allocate more if neeeded), so that people can set a maximum. (MUST be user configurable) Repo Size Constraints #972node.repo.datastore.storage_max: hard limit on datastore storage size. could be computed asrepo.storage_max - configsizewhereconfigsizecould be live, or could be a reasonable bound. Repo Size Constraints #972node.repo.datastore.storage_gc_watermark: soft limit on datastore storage size. after passing this threshold, automatically run gc. could be computed asnode.repo.datastore.storage_max - 1MBor something. Repo Size Constraints #972node.network_bandwidth_max: limit on network bandwidth used.node.gateway.bandwidth_max: limit on bandwidth allocated to running the gateway. this could be calculated fromnode.network_bandwidth_max - all other bandwidth use. gateway limitations #1070node.swarm.bandwidth_max: limit on network bandiwdth allocated to running the ipfs protocol. this could be calculated fromnode.network_bandwidth_max - all other bandwidth use.node.dht.bandwidth_max: limit on network bandwidth allocated to running the dht protocol. this could be calculated fromnode.network_bandwidth_max - all other bandwidth use.node.bitswap.bandwidth_max: limit on network bandwidth allocated to running the bitswap protocol. this could be calculated fromnode.network_bandwidth_max - all other bandwidth use.node.swarm.connections: soft limit on ipfs protocol network connections to make. the reason for this limit is that there is overhead to every connections kept alive. the node could try to stay within this limit.node.gateway.ratelimit: a number of requests per second. with this limit, the user could reduce the accept load on the gateway. gateway limitations #1070node.memlimit: a limit on the memory allocated to ipfs. could try to use smaller buffers if under different constraints. this is hard to do, prob wont be used end-user-side, and likely easier to do with tools around it sysadmin-side (docker, etc).note on config: the above keys need not be the config keys, but we should figure out some keys that make sense hierarchically.
What other things are we interested in limiting?