[GH-ISSUE #460] Is it possible using sendfile() system call to reduce cpu usage and increment download speed ? #252

Closed
opened 2026-04-08 16:51:29 +03:00 by zhus · 3 comments
Owner

Originally created by @zsimple on GitHub (Oct 8, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/460

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?

Originally created by @zsimple on GitHub (Oct 8, 2024). Original GitHub issue: https://github.com/sigoden/dufs/issues/460 ## 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](https://github.com/user-attachments/assets/7692564d-304c-49a1-9847-fc4398216149) ## 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?
zhus closed this issue 2026-04-08 16:51:30 +03:00
Author
Owner

@sigoden commented on GitHub (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.

<!-- gh-comment-id:2398668521 --> @sigoden commented on GitHub (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](https://github.com/user-attachments/assets/8cb68c1b-d631-44b7-8df1-273a198641bb) > PR #451 improved the speed; you may want to try it.
Author
Owner

@zsimple commented on GitHub (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.

<!-- gh-comment-id:2398880056 --> @zsimple commented on GitHub (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](https://github.com/user-attachments/assets/e1ce8031-df2e-40e9-8e15-388947478296) case 1: run rsync on B nas, copy file from A, can reach to 25M/s and up. ![image](https://github.com/user-attachments/assets/bbc1c9d2-069b-4719-aea0-2f5b16621242) case 2: run dufs on B nas and download file to A nas, 70M/s and up ![image](https://github.com/user-attachments/assets/e11289ef-ebf4-4a2e-afd4-ed8ab5c1dd0a) 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.
Author
Owner

@zsimple commented on GitHub (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.

<!-- gh-comment-id:2398909878 --> @zsimple commented on GitHub (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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#252