Discussion

Samba speed incredibly slow

16 15525
tkaiser  
There exists a simple rule: Test network throughput and local storage throughput individually (I prefer iperf and iozone for that) and you immediately get a clue what's going wrong. When you always just do combined network/storage stuff you will be fooled even by caches/buffers on different layers of the ISO/OSI stack.

shadoom  
tkaiser replied at Thu Jan 1, 2015 06:16
There exists a simple rule: Test network throughput and local storage throughput individually (I pre ...

what settings/options do you recommend for iozone and iperf?
I tried iozone for a bit with the results:
  1. iozone -R -t 2 -s 20m -+u -b kingstonEXT3.xls -F /mnt/usb/ext3.1 /mnt/usb/ext3.2                
  2. Throughput report Y-axis is type of test X-axis is number of processes               
  3. Record size = 4 Kbytes               
  4. Output is in Kbytes/sec               
  5.   Initial write                 197110,0078
  6.         Rewrite                 201121,6914
  7.            Read                 821597,4375
  8.         Re-read                 819115
  9.    Reverse Read                 729601,9063
  10.     Stride read                 730685,2188
  11.     Random read                 714662,4063
  12. Mixed workload                 320752,0625
  13.    Random write                 206635,2266
  14.          Pwrite                 82938,18359
  15.           Pread                 689320,5
  16.          Fwrite                 204164,1406
  17.           Fread                 741386,1563
  18. CPU utilization report Y-axis is type of test X-axis is number of processes               
  19. Record size = 4 Kbytes               
  20. Output is in CPU%               
  21.   Initial write                 128,236908
  22.         Rewrite                 134,5496826
  23.            Read                 164,740921
  24.         Re-read                 165,0098877
  25.    Reverse Read                 180,7469025
  26.     Stride read                 180,502655
  27.     Random read                 200
  28. Mixed workload                 137,352356
  29.    Random write                 135,5960541
  30.          Pwrite                 133,5482941
  31.           Pread                 177,6299133
  32.          Fwrite                 121,2149734
  33.           Fread                 167,2436676
Copy the Code
Those numbers seem to be off for a USB2 stick, dont they?

tkaiser  
I would use at least twice the size as the amount of RAM. To measure sequential write/read chdir into the specific directory and do
  1. iozone -a -g 2000m -s 2000m -i 0 -i 1 -r 4|32|512|16384K
Copy the Code
(you would have to use the different record sizes individually so start with "-r 4K" and increasing the record size afterwards)

shadoom  
I tried 2000m a couple of times instead of 1000m but it had the same results so I went for 1000m as waiting 30 minutes was a pain.

  1. Kingston USB2 EXT4

  2.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 4
  3.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  4.          1024000       4    5119    4877    26005    26321

  5.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 32K
  6.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  7.          1024000      32    5127    5006    26188    26236

  8.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 512K
  9.               KB  reclen   write rewrite    read    reread    read   write    re
  10.          1024000     512    5036    4977    26131    26233                                                                                                                                                                             

  11.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 16384K
  12.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  13.          1024000   16384    5111    5075    26674    26761

  14.         Command line used: iozone -a -g 2000m -s 2000m -i 0 -i 1 -r 16384K
  15.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  16.          2048000   16384    4900    4965    25118    25155

  17. Kingston USB2 NTFS                 

  18.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 16384K
  19.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  20.          1024000   16384    5329    5375    21147    23086

  21. Sandisk USB3 NTFS
  22.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 16384K
  23.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  24.          1024000   16384    9943   13246    29293    29295

  25.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 4K
  26.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  27.          1024000       4    7650    9891    26305    26535

  28. Sandisk USB3 EXT4
  29.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 4K
  30.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  31.          1024000       4   17027   29462    27566    24502

  32.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 32K
  33.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  34.          1024000      32   11004   26971    32135    32628

  35.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 512K
  36.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  37.          1024000     512   12882   29348    32171    32732

  38.         Command line used: iozone -a -g 1000m -s 1000m -i 0 -i 1 -r 16384K (did this one a couple of times as it varied the first 4 times a lot)
  39.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  40.          1024000   16384    6856   24956    34361    34306
  41.          1024000   16384   20529   29672    33994    34258
  42.          1024000   16384    9992   25131    33932    34042
  43.          1024000   16384   11381   26278    34147    33969
  44.          1024000   16384   11368   25886    32531    33993
  45.          1024000   16384   10505   30411    33304    33755
  46.          1024000   16384   10154   28390    34192    33714
  47.          1024000   16384   33204   33929    34309    34578 (switch)
  48.          1024000   16384   34089   33807    34341    34519 (switch)
  49.          1024000   16384   33900   34241    34294    34553

  50.         Command line used: iozone -a -g 2000m -s 2000m -i 0 -i 1 -r 4K
  51.          2048000       4   13499   29343    31378    31092
  52.          2048000       4   31383   32136    30031    29849 (switch)
  53.          2048000       4   33284   33326    30941    30977 (switch)

  54.         Command line used: iozone -a -g 2000m -s 2000m -i 0 -i 1 -r 16384K
  55.               KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
  56.          2048000   16384   10909   25680    31560    31983
  57.          2048000   16384   10178   30590    31472    31829
  58.          2048000   16384   10101   30208    31964    31954
  59.          2048000   16384    9670   29913    32003    32074
  60.          2048000   16384   27399   32798    31821    31859 (switch)
  61.          2048000   16384   32902   32638    32293    32365
Copy the Code
The USB3 stick does 30mb/s writing on a USB2 port on windows and 90mb/s writing on a USB3 port on windows.
So 10mb/s writing seems too slow on the bpi, even on EXT4. It jumps around in writing speed a lot without me doing anything else on the bpi except iozone.
----
About the "(switch)"... without rebooting the bpi i simply removed the bpi ethernet cable from the router and plugged it into my switch and somehow the speed got stable 30mb writing. When I replugged the cable to the router the speed persisted to be around stable 30mb/s. I know that the ethernet should not have anything to do with the throuhput of the USB port...except for the shared power maybe but ... I don't know anymore... is my bpi possessed?

Well, I made that experience as well that some USB flash drives perform differently on linux. This happened to me on x86 hardware as well, so I doubt that it has to do with ARM hardware or the Banana Pi itself. I never investigated this further because it was only two out of at least a dozen drives that behaved this way. So I can't really helpt you with that. But at least you know now sambais not the problem.

About the CPU usage: When writing to a samba share the CPU usage on my Banana Pi is also very high - usually around 90-100%. This is only true for writing. During reads the cpu usage is significantly lower.

tkaiser  
Ok, your Kingstom thumb drive is really slow (and this might explain why write speeds over Samba started with 20-30 MB/s and decreased to the actual write speed of the device when write buffers were full).

Regarding interference of network with USB througput. The only thing I could think of might be IRQ assigning where something goes horribly wrong. I would try to assign all USB IRQs to CPU1 (or all eth0 IRQs), do a restart and have a look again. Is the dmesg output somewhat helpful?

shadoom  
tkaiser replied at Fri Jan 2, 2015 05:56
Ok, your Kingstom thumb drive is really slow (and this might explain why write speeds over Samba sta ...

Yeah i noticed it about the kingston one.
But the Sandisk one is usually pretty fast... I'll do some more testing today and hopefully it will stay at 30mbs

Thanks for all your replies

You have to log in before you can reply Login | Sign Up

Points Rules