Skip to content
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

Unexpected network overhead: 1800% #4612

Closed
nanw1103 opened this issue Jan 26, 2018 · 3 comments
Closed

Unexpected network overhead: 1800% #4612

nanw1103 opened this issue Jan 26, 2018 · 3 comments

Comments

@nanw1103
Copy link

nanw1103 commented Jan 26, 2018

Version information:

go-ipfs version: 0.4.13-
Repo version: 6
System version: amd64/windows
Golang version: go1.9.2

Type:

Enhancement

Severity:

Medium

Description:

My experiment scenario:
Setup 1: A private swarm with 30 IPFS nodes (bootstrap contains only the nodes in the network itself), in an isolated private network (LAN).
Setup 2: File A, size 10 MB, full random content without duplicated block at 256KB.

Step 1: Snapshot the current bandwidth usage of total network, by "ipfs stats bw" on all nodes, and sum the bytes-in.
Step 2: "ipfs add File_A" on node1
Step 3: "ipfs get File_A_hash" on all nodes
Step 4: The same as Step 1, snapshot the bandwidth usage of the network.
Step 5: Calculate delta between Step 4 and Step 1 to know the total network bandwidth cost.

Theoretically the ideal network transfer should be (30 - 1) * 10 = 290 MB. The actual result from Step 5 is 5339MB, which is about 1800%.

P2P for sure will have some overhead, however 1800% seems too high.

@nanw1103
Copy link
Author

nanw1103 commented Jan 26, 2018

Further investigation to know whether it's an issue with the "ipfs stats bw" or the swap implementation: checked OS network card statistics. It matches (approximately) the report from "ipfs stats bw". So it seems some optimization possibilities in the block swap implementation.

@Stebalien
Copy link
Member

Stebalien commented Jan 26, 2018

Thanks for the detailed report!

Unfortunately, this is a known issue. You're probably seeing thisbecause some peers are downloading faster than others. When the lagging peers ask the network for the pieces of the file, they'll get it from everyone (not good). We're working on fixing this by using something we call bitswap sessions, see: #3786

You can actually check this by looking at the "dup blocks received" field of ipfs bitswap stat on each peer.

This could also be other traffic but that's unlikely. You can check that by looking at, e.g.:

> ipfs stats bw -t /bitswap/1.1.08

(and comparing it to other protocols)


Also note, ipfs stats bw is off by a factor of 5: #4476 (should be fixed next release).


To try to keep these conversations in one place, I'm going to close this in favor of #4588.

@nanw1103
Copy link
Author

nanw1103 commented Jan 28, 2018

Close as Stebalien's comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants