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

Is it possible using sendfile() system call to reduce cpu usage and increment download speed ? #460

Closed
zsimple opened this issue Oct 8, 2024 · 3 comments

Comments

@zsimple
Copy link

zsimple commented Oct 8, 2024

Specific Demand

I run dufs on a weak arm cpu NAS, it works very well, until I want to download a large file (10+G for example), wget only has 10M/s download speed. I use a ssd and benched the disk read speed with dd, 150M/s is shown, of couse the network is ok too.

I found dufs use 100% single core cpu, may be that is the reason?

image

Implement Suggestion

When I use nginx, sendfile on works very well, cause it skips the read/write function and use sendfile system call, so is it possible add this feature in dufs? I haven't read the source code yet, is it will make dufs more powerful?

@sigoden
Copy link
Owner

sigoden commented Oct 8, 2024

The transfer speed bottleneck is multifaceted; specifically for dufs, it is primarily caused by the network, not the disk.

10M/s is the limit of your network, not the limitation of dufs. On my network, dufs can easily reach speeds of nearly 900M/s.

image

PR #451 improved the speed; you may want to try it.

@sigoden sigoden closed this as completed Oct 8, 2024
@zsimple
Copy link
Author

zsimple commented Oct 8, 2024

The transfer speed bottleneck is multifaceted;

I accept to it, but for sure I have tested my network, it's not the bottleneck in my case, maybe I must apply more info as below.

I have two nas, A is arm arch, B is x86 arch.

case 0: run dufs on A nas, and run wget on B nas, the speed is about 10~20M/s, as I said in this issue
image

case 1: run rsync on B nas, copy file from A, can reach to 25M/s and up.
image

case 2: run dufs on B nas and download file to A nas, 70M/s and up
image

Obviously my network is not so fast(only 1Gb), but A --> B and B --> A should be the same speed, and the test show different result.

@zsimple
Copy link
Author

zsimple commented Oct 8, 2024

More info, may be useful.

I am running dufs on A nas with docker, which is old (v19.03). If I run dufs directly, download speed can up to 30M/s, faster then rsync, much better...

And the arm cpu is RK3328, old and weak.

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