When copying a 2 GB file from HDD to USB stick, the initial speed is about 80 MB/sec, and decreases steadily to 10 MB/sec or even less.
Why is this so? The answers I've found says it's related to cache. But if the file is being copied only once, what does the cache have to do with it? I thought cache was used for information copied more than once.
I'm using Nautilus on Debian/Gnome, if it makes a difference.
EDIT - Adding some benchmarks
Before copying a 2.4 GB mp4 file, I repeatedly ran some checksums on it, to see how long it takes only to read the file, and also expecting to put it on the disk cache:
sha512sum file.mp4 (3x)
19s
8s
6s
sha256sum file.mp4 (3x)
10s
10s
10s
sha512sum file.mp4 (3x)
6s
6s
6s
It seems the file went to cache.
Next, I copied it to the USB stick. The default mounting on Debian 10 is asynchronous. The amount copied each minute, the remaining time and the overall speed were:
few sec 985 MB 13sec left 116 MB/s
1min 1.1 GB 1 min left 18.6 MB/s
2min 1.4 GB 1 min left 11.7 MB/s
3min 1.7 GB 1 min left 9.7 MB/s
4min 2.1 GB 35sec left 8.7 MB/s
4min45 "done"
eject
(it doesn't inform how long it will take)
+2min22 "ejecting" = ~7min total
2403758161÷427 = 5629410.2 = 5.63 MB/s = 5.37 MiB/s
Then I mounted the USB stick with the option -sync
, and registered the same info each minute:
few sec 20min left 2 MB/s
30s 9 min left 3.9 MB/s
1min 272 MB 7 min left 4.5 MB/s
2min 500 MB 7 min left 4.2 MB/s
3min 744 MB 6 min left 4.1 MB/s
4min 1.1 GB 5 min left 4.4 MB/s
5min 1.4 GB 3 min left 4.6 MB/s
6min 1.7 GB 2 min left 4.6 MB/s
7min 2.0 GB 1 min left 4.6 MB/s
8min 2.3 GB 36sec left 4.7 MB/s
8m26s done
eject
instantaneous
2403758161÷506 = 4750510.2 = 4.75 MB/s = 4.53 MiB/s
Conclusions:
The checksum indicates that the time to copy the file to memory is much smaller than the total copy time. So it seems incorrect to use it as part of the overall speed estimation.
Synchronous copy seems to be a little slower, but at least it correctly informs the time remaining.