mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #460] Is it possible using sendfile() system call to reduce cpu usage and increment download speed ? #252
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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?
Implement Suggestion
When I use nginx,
sendfile onworks 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 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.
@zsimple commented on GitHub (Oct 8, 2024):
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

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

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

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 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.