-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: improved fs uploads performance #2333
Conversation
grumbach
commented
Oct 28, 2024
•
edited
Loading
edited
- Parallel file uploading with capped concurrency to avoid memory burst
- Parallel chunk uploading with capped concurrency to avoid memory burst
- Local testing reveals this PR improves upload performance of CLI directories upload by x50 FIFTY!!
- Configurable batching for files and chunks through env vars
autonomi/src/client/fs.rs
Outdated
|
||
use super::archive::{Archive, ArchiveAddr}; | ||
use super::data::{DataAddr, GetError, PutError}; | ||
|
||
pub(crate) const FILE_UPLOAD_BATCH_SIZE: usize = 128; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale behind 128? Do we need batching at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with unlimited and my memory useage spiked to the moon.
So it seems you were right about batching, and we probably need some. Local testing revealed that 128 was a sweet spot (at least on my machine), not too high for mem, not too slow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do worry a little about the relative performance (e.g. PC vs Raspberry Pi). Can we relate this value to CPU core count?
https://doc.rust-lang.org/std/thread/fn.available_parallelism.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh excellent! Yes!
Good one! What about a couple of tests? To check file integrity and probably we can profile in the future. |
75b67c5
to
e8e16b7
Compare
.github/workflows/merge.yml
Outdated
- name: Run autonomi tests | ||
timeout-minutes: 25 | ||
run: cargo test --release --package autonomi --lib --features="full,fs" | ||
|
||
- name: Run autonomi tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the same workflow is repeated twice! Run autonomi tests
Maybe some rebase conflicts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I'm actually sneaking this back in as it was removed as a side effect of:
#2334
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh cool!
e8e16b7
to
ade585f
Compare
12b57ad
to
5d4f926
Compare