-
Notifications
You must be signed in to change notification settings - Fork 66
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
Excessive Has()/GetSize() calls, caching? #113
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
This "Key List" could possibly also just exist in memory, though that could become problematic if simply too many keys exist in the s3 bucket (which is very possible, as these buckets can become quite large) |
I discovered that GetSize() is getting a sizable amount of calls as well, through profiling it in |
@MichaelMure any thoughts? |
@ShadowJonathan the right way to deal with this is to use the bloom filter cache: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#datastorebloomfiltersize. However, this will list every block you have on start. |
There's also an ARC cache to remember whether or not we have blocks (and their sizes). Unfortunately, the size of that cache is not tunable. See ipfs/go-ipfs-config#41 for some WIP work there. In general, modifying this datastore directly is not the right approach |
Note: I'm happy to re-open this if you disagree. I just don't want to leave it around given how old it is. |
I'm currently having a problem with using this plugin for b2 backblaze storage, which has an s3 API, they charge for "Class B" transactions, under which
HeadObject
falls, whichGetSize
uses, which in turn is used byHas()
As far as I know,
Has()
is called every time a bitswap request comes over the network, to see if the block can be provided to the other node, with the rate at which this happens, however, the transactions quickly build up, and I'm looking at a 300K transaction count just after bringing this node up for just 5 hours.That in turn translates to some significant monthly extra costs, is it possible to "cache" the keys available in the s3 bucket? To perform a
ListObjects
call every minute or so, and to update a local "Key List" file which'd everyHas
call will be validated against (performing no calls to the s3 api), aPut
should then automatically add that key to the list.The text was updated successfully, but these errors were encountered: