Replies: 1 comment 2 replies
-
Using a queue would give you better concurrency control, yes.
It's defined in the Kademlia paper and is per query.
Announcing lots of CIDs is expensive and has a knock-on effect on the reprovide queue - do you need to provide all the intermediate files and directories or will just the root do? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Assuming you merkelize some files with Helia and UnixFS as follows:
And now you have the
toProvide
array, what's the best way to announce all of those cids to the kad-dht concurrently?A naive implementation would look as follows:
However, as the number of CIDs grows this can cause network spikes. Moreover, each of the
helia.routing.provide(cid)
calls instantiates a concurrent queue with Alpha concurrency parameter (α). The spec isn't clear whether that concurrency parameter is global or per operation.So I guess the question here is: should one use a concurrent queue like
@libp2p/utils/queue
when calling multiple provides?Beta Was this translation helpful? Give feedback.
All reactions