Slow USB on my old RaspPi ?

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Slow USB on my old RaspPi ?

Postby tomcheng76 » Tue Mar 18, 2014 1:48 pm

This is the test, the usb harddrive is Seagate expansion desktop
$this->bbcode_second_pass_code('', 'dd if=/dev/zero of=/media/external/test.img bs=2k count=1024k')
On Goflex Net , it has 27MiB/s, on Respberry Pi, it has only 12-15MiB/s
Is it Normal? The RaspPi is old 256M Model B, latest alarmpi image with pacman -Syu
Please report your speed
Thanks :)
tomcheng76
 
Posts: 130
Joined: Mon Dec 13, 2010 11:24 am

Re: Slow USB on my old RaspPi ?

Postby sdjf » Tue Mar 18, 2014 3:48 pm

Not able to test right now, but I believe the class of your SD card plays a major role in speed. I am using class 4 and know that is slower than the class 10 cards, from what I have read.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: Slow USB on my old RaspPi ?

Postby tomcheng76 » Wed Mar 19, 2014 1:23 am

I am not sure if SD card is related, since pi is writing to the separated hard drive, anyway it is a class 6 SD card.

Here are the mount entries, notice that the seagate drive is mount as ext3 (rw,noatime,data=writeback)
$this->bbcode_second_pass_code('', '/dev/mmcblk0p5 on / type ext4 (rw,noatime,discard,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=51560k,nr_inodes=12890,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /var/log type tmpfs (rw,nosuid,nodev,noexec,noatime,size=4096k,mode=755)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
/dev/sda1 on /media/external type ext3 (rw,noatime,data=writeback)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
')
tomcheng76
 
Posts: 130
Joined: Mon Dec 13, 2010 11:24 am

Re: Slow USB on my old RaspPi ?

Postby moonman » Thu Mar 20, 2014 10:56 am

Remember that this is OTG USB port and the same host is shared between multiple devices, including the builtin network adapter.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Slow USB on my old RaspPi ?

Postby tomcheng76 » Thu Mar 20, 2014 12:45 pm

$this->bbcode_second_pass_quote('moonman', 'R')emember that this is OTG USB port and the same host is shared between multiple devices, including the builtin network adapter.

Thanks moonman!
although usb-devices shows me the details, i didn't realize it :oops:
$this->bbcode_second_pass_code('', 'T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 1
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev=03.10
S: Manufacturer=Linux 3.10.33-1-ARCH dwc_otg_hcd
S: Product=DWC OTG Controller
S: SerialNumber=bcm2708_usb
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 3
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=02 MxPS=64 #Cfgs= 1
P: Vendor=0424 ProdID=9512 Rev=02.00
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA
I: If#= 0 Alt= 1 #EPs= 1 Cls=09(hub ) Sub=00 Prot=02 Driver=hub

T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0424 ProdID=ec00 Rev=02.00
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=smsc95xx

T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0bc2 ProdID=3320 Rev=01.00
S: Manufacturer=Seagate
S: Product=Expansion Desk
S: SerialNumber=NA4MLA72
C: #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage')

Actually this is my ultimate question. Currently my Samba only get 5MB/s which is very poor.
I understand that there is large overhead in samba. Do you have any suggestion on samba performance setting specially for rasppi ?

Currently i am using
$this->bbcode_second_pass_code('', ' socket options = SO_RCVBUF=65535 SO_SNDBUF=65535 SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY')

Thanks again!
tomcheng76
 
Posts: 130
Joined: Mon Dec 13, 2010 11:24 am

Re: Slow USB on my old RaspPi ?

Postby moonman » Thu Mar 20, 2014 8:09 pm

I don't think you can. In theory it samba should be ~15 MB/s since USB is maxed out at 30, and you are using NIC on the same USB controller as the hard drive.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Slow USB on my old RaspPi ?

Postby tomcheng76 » Fri Mar 21, 2014 1:48 am

Thanks for the explanation :) , new config get 6-7MiB/s, it is just a little bit sad that i cant get 10MiB/s

$this->bbcode_second_pass_code('', ' socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVBUF=65535
max connections = 65535
max open files = 65535')
tomcheng76
 
Posts: 130
Joined: Mon Dec 13, 2010 11:24 am

Re: Slow USB on my old RaspPi ?

Postby moonman » Fri Mar 21, 2014 9:30 am

Check the cpuload and iowait in top while doing the transfer. Also try the -latest kernel with elevator=bfq in cmdline.txt. It might help
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Slow USB on my old RaspPi ?

Postby tomcheng76 » Sun Mar 23, 2014 10:41 am

Here is the top snapshot
$this->bbcode_second_pass_code('', 'top - 18:38:57 up 22:08, 1 user, load average: 1.10, 0.42, 0.29
Tasks: 75 total, 3 running, 72 sleeping, 0 stopped, 0 zombie
%Cpu(s): 5.8 us, 40.8 sy, 0.0 ni, 4.9 id, 0.6 wa, 0.6 hi, 47.2 si, 0.0 st
KiB Mem: 213952 total, 58408 used, 155544 free, 1568 buffers
KiB Swap: 524284 total, 27152 used, 497132 free. 16836 cached Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
19295 bomber 20 0 42620 1752 864 R 66.8 0.8 5:50.54 smbd
3 root 20 0 0 0 0 R 6.1 0.0 29:36.29 ksoftirqd/0
60 root 20 0 0 0 0 D 4.2 0.0 18:43.08 usb-storage
2896 http 20 0 30240 5288 1748 D 3.8 2.5 31:14.40 php-fpm
20 root 20 0 0 0 0 S 2.9 0.0 12:13.24 kswapd0
144 root 20 0 4808 240 240 S 2.6 0.1 13:14.18 haveged
19477 root 20 0 0 0 0 S 1.9 0.0 0:02.02 kworker/u2:2
46 root 20 0 0 0 0 S 1.3 0.0 14:59.81 mmcqd/0
140 root 20 0 1672 184 184 S 1.3 0.1 5:36.52 rngd
19750 bomber 20 0 4764 1228 952 R 1.0 0.6 0:00.24 top
287 http 20 0 5728 924 688 S 0.6 0.4 1:27.97 nginx
1 root 20 0 4216 1752 1164 S 0.3 0.8 0:52.67 systemd
47 root 0 -20 0 0 0 S 0.3 0.0 0:56.06 kworker/0:1H
145 dbus 20 0 3632 708 564 S 0.3 0.3 0:29.87 dbus-daemon
19054 root 20 0 0 0 0 S 0.3 0.0 0:24.99 kworker/0:2
2 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kthreadd
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H')

Thanks for the idea!
It is now running bfq, so i think there is not much i can do, nearly no swap activity
tomcheng76
 
Posts: 130
Joined: Mon Dec 13, 2010 11:24 am

Re: Slow USB on my old RaspPi ?

Postby moonman » Mon Mar 24, 2014 12:06 am

Cpu is maxed out and soft interrupts are eating 47%. Basically cpu spend half of its time handling interrupts and this is due to the driver. You may try to disable fiq split transaction but it may cause other errors like jittery sound.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 21 guests