1

I am using a raspberry pi with samba as remotely accessible storage in my local network. While copying files from windows to pi I am getting strange transfer speed. It jumps from 200 kB/s and less to 10 MB/s. It always stays for about 2 seconds at the low speed, then for the same time at the high speed.

Anyone has in mind what could be the cause? Bad USB flash drive, badly configured samba or is it just showing inaccurate speed because copying to different file system?

Speed

goldilocks
  • 87,661
  • 30
  • 204
  • 262
Ko Cour
  • 113
  • 3

1 Answers1

1

I suspect that the bottleneck is writing to the USB flash drive. USB flash drives are typically at the low end of the performance/price range. Data accumulates in memory at 10MB/s up to a point, then gets written out at 200kB/s.

You can try playing with the vm.dirty_bytes and vm.dirty_background_bytes kernel parameters. Setting them to a lower value might make the writing more uniform. However, it might also make the average speed lower: buffering writes on flash media is good for throughput, because flash blocks needs to be erased before writing — if the same block needs to be erased and rewritten multiple times, this reduces performance (and reduces the longevity of the drive as well).