-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Ipfs Performance Tweaks #404
Conversation
Are the leveldb locks actually more expensive than what this agent would do? (either sync.Mutex or channels). How granular are the locks? full serialization is not what we want, we want to do as much as we possibly can in parallel.
What does this one mean?
Expand too? This could mean a few different approaches, and want to make sure we're on the same page.
vague.
+1 |
My goal with the blockstore agent isnt so much to serialize the disk writes, but to avoid the goroutine buildup, at one point i had 3000 goroutines trying to write to the datastore. |
What do you have in mind? the goroutines are created by clients. we need to make sure the writes complete (consistency). not sure we're talking about the same things |
Hrm... thinking about it more, maybe that wouldnt help anything |
194cd5b
to
0b714ea
Compare
Before we begin a large performance effort, what specific concrete performance issues are we currently facing? We may want to consider looking at network reliability (ie. reachability, message delivery) before setting out to increase throughput and reduce latency.
Would this be more reliably addressed by re-ordering the blocks locally as a stage in the response pipeline?
Async disk writes, as @jbenet mentioned, inhibit consistency. The root cause of this was overzealous goroutine generation in the network layer. Don't we just need to apply backpressure when producers are working faster than consumers?
We recently addressed LevelDB's write compaction issues. Afaik, this is no longer a bottleneck. Has something changed? |
We are currently completely unable to transfer a file larger than around 50MB due to quickly running out of memory. re: Bitswap Request batching, if done properly, it should significantly improve latency. Currently, no order is implied in the requesting of a block, so the time until you have usable data is very unpredictable, in my opinion this is very bad. If your bandwidth is at most X blocks per second it wont make a difference to the overall speed of the operation if you only request X blocks at a time, i would prefer to receive blocks towards the front of the file first so we can stream, as opposed to random blocks throughout the file. As for the levelDB issues, i dont beleive that was ever actually addressed, i think we just stopped hitting it so hard. I think what im seeing is network speeds greater than levelDB write speeds causing a chokepoint |
Yeah they were. The solution ended up being pretty simple. The culprit was unnecessary snappy compression during write compaction.
It's that producers on the network side are spewing goroutined requests up to bitswap faster than bitswap can retrieve off of the disk. This is the fault of the network layer for not responding to back-pressure. |
How was the compaction issue addressed? |
Compaction was a red herring. Compression made compaction take too long and when compaction took too long, writes backed up. We blamed it on compaction because it was an easy target and the internet seemed to back up that hypothesis, but the root cause was expensive compression during compaction.
What's our best guess as to why this is happening? |
keys at the front/head of the wantlist are deemed higher priority. priority is expressed through the order of the wantlist. |
So, how was the "not compaction" issue fixed? On Fri, Dec 5, 2014, 6:01 PM Brian Tiger Chow [email protected]
|
I linked to it in a previous comment. Didn't realize you didn't see the link. ff490a6 |
Ah, totally missed that that link was the fix. As for the wantlist being On Fri, Dec 5, 2014, 6:17 PM Jeromy Johnson [email protected] wrote:
|
The wantlist should be a hybrid that uses both a slice and a map. The map to prevent duplicates. A slice to preserve ordering. This is done in the https://github.com/jbenet/go-ipfs/blob/master/exchange/bitswap/message/message.go#L46
oops. this is a bug. |
@whyrusleeping wrote
Is this recent? I've done that many times before. It's 1GB+ that has been failing for me. @maybebtc wrote
This is an important issue. It was just addressed, though, yeah? FWIW, i think we all agree here that we want to make sure to measure things correctly and outline the perf issues before optimizing blindly. I think @whyrusleeping has good instincts he's following, and @maybebtc is right to want measurements before diving into something. Particularly since we have very little time to release this (I'll write at length about this tomorrow, but we're shipping this before end of the year). Let's make sure we have concrete measured bottlenecks before jumping into things (like memory usage, and concurrency issues). |
@maybebtc for the wantlist, we should probably use that same wantlist object for the wantlists in ledger. @jbenet Ive been able to get a file around 50MB through over WAN, but above 100MB things fail. I think most of the failures will be fixed with the msgio changes, but im not super confident in that yet. We will see once that lands |
Indeed.
A little over a month ago, I transferred 1.5GB to cryptix. This is an interesting regression. We may want to create an integration test that performs a large file transfer. |
Closing, concerns have been mostly addressed, this PR no longer needed. |
This PR will be the staging ground for ipfs performance fixes. It will be nice to have all of these changes in a single place so we can easily test performance of this branch against master.
My list of hopeful features is:
handleOutgoingMessage
not a goroutinefunc (rw *ReadWriter_) Close()