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?


  • This could have gone to Superuser, but I suspect it is more likely to get better treatment here. – goldilocks Dec 14 '14 at 15:10

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.