Giter VIP home page Giter VIP logo

Comments (6)

Jorropo avatar Jorropo commented on September 25, 2024

I was hopping to rethink how this whole logic is applied such that you wouldn't need to turn off fairness in high trust environment because fairness would only comes into play when resources are constrained.
However I lack the time to do so. I'll be happy to review a for your option.

from kubo.

Dreamacro avatar Dreamacro commented on September 25, 2024

I explained that briefly in ipfs discuss.

In this private network, only one node owns the file at the beginning (usually a large file, and no new file will be added anytime soon). I want this file to be sent to each peer as fast as possible, and the peers to be connected to each other in a DHT so they can send the received blocks to the other peers.

The result of this attempt is that at 80 or 100 peers, the entire p2p transfer becomes slow, about twice as slow as at a lower number of peers. I had to troubleshoot the cause of the slowness. The bandwidth on the private network is abundant, more than Bitswap's traffic rate (as seen in metrics and system monitoring), so I started tweaking Bitswap's config, but there wasn't much real improvement.

I noticed that bitswap has a debt system. If I understand it correctly, it encourages peers to upload as much as possible, otherwise, it affects the transfer priority. It defeats the purpose of what I'm trying to do, I don't care about transfer priority, I want to get the file to each peer as fast as possible. If more peers have the full file, it makes the whole transfer process faster.

Back to the enhancement of disabling ScoreLedger, I was thinking of something similar to Swarm.ConnMgr, with a default and none value, and when the value is none, there will be an empty implementation of ScoreLedger. Do you think this is acceptable?

from kubo.

hsanjuan avatar hsanjuan commented on September 25, 2024

@Dreamacro did you try disabling it by hand and that solved your issue?

from kubo.

Dreamacro avatar Dreamacro commented on September 25, 2024

@hsanjuan The testing process is complex and will take a long time to observe and validate. But I did observe such a phenomenon:

I made an api to watch the inbound/outbound traffic between each peer and other peers after a download. Before disabling ScoreLegder (which implements an empty ScoreLegder), most traffic was from the kubo (i.e., the node that initially owned the file). After the disable the total inbound from kubo is lower (but still around 50%). This indicates that p2p between nodes becomes more frequent after disabling ScoreLegder.

from kubo.

aschmahmann avatar aschmahmann commented on September 25, 2024

triage:

  • Disabling the ScoreLedger will likely result in some unexpected edge cases (e.g. peers getting pruned by the connection manager while you're downloading from them), that would require a bunch of explanation and warnings in the docs section if this was added as an option to Internal.Bitswap
  • It's likely the the DefaultScoreLedger has issues like lock-content or overly used CPU/lack of parallelism. @Dreamacro if when you run comparisons you could collect some profiles to determine likely issues that would be great, and likely lead to a fix and better result overall compared to just turning off the ScoreLedger.

from kubo.

Dreamacro avatar Dreamacro commented on September 25, 2024

Thanks all, after testing I realized that the "traffic is downloading from the initial node" behavior was due to merkledag.NewSession. This was a trick I learned from ipfs discuss, but it was not what I was aiming for. After getting the node through dag usually, the p2p behavior became normal again.

So I'll close this issue for now, but the slow fetch on multiple nodes is still being tested accordingly, thanks again for all the help!

from kubo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.