Sat Apr 13, 2013 5:46 am
You got me curious about the Pi's throughput, and I wanted to check what throughput I saw on my USB GbE adaptor some years ago, so I connected it up to my Pi:
(dmesg from the pi)
[1252007.361766] usb 1-1.2.1: new high-speed USB device number 36 using dwc_otg
[1252007.475437] usb 1-1.2.1: New USB device found, idVendor=0b95, idProduct=1780
[1252007.475485] usb 1-1.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1252007.475505] usb 1-1.2.1: Product: GU-1000T
[1252007.475520] usb 1-1.2.1: Manufacturer: PLANEX COM. Inc.
[1252007.873476] asix 1-1.2.1:1.0: eth1: register 'asix' at usb-bcm2708_usb-1.2.1, ASIX AX88178 USB 2.0 Ethernet
[1252007.875912] usbcore: registered new interface driver asix
[1252011.803700] asix 1-1.2.1:1.0: eth1: link up, 1000Mbps, full-duplex, lpa 0xCDE1
Configured the interface on a separate subnet:
$ sudo ifconfig eth1 192.168.100.2/24
Then run a quick ethernet throughput test using UDP:
$ sudo iperf -c 192.168.100.1 -u -b300M
------------------------------------------------------------
[ 3] local 192.168.100.2 port 48522 connected with 192.168.100.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 136 MBytes 114 Mbits/sec <----- huh? 114Mbps...
Only getting 114Mbps, however the Pi's CPU is pegged at 100%:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2583 root 20 0 19664 1144 960 S 97.4 0.2 0:04.79 iperf
2581 jnihil 20 0 5204 1404 1028 R 1.0 0.3 0:00.42 top
You're quite right. You won't get 250Mbps on a Pi.
I then moved the same USB NIC to a laptop with more cpu power and did the same test:
$ sudo iperf -c 192.168.100.1 -u -b300M
------------------------------------------------------------
[ 3] local 192.168.100.2 port 40604 connected with 192.168.100.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 286 MBytes 240 Mbits/sec <----- Much better
This time we're not cpu-bound (Core2 Duo U7500 1.06GHz):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3534 root 20 0 96716 1108 928 S 35 0.1 0:02.53 iperf
3302 jnihil 20 0 31020 2264 1408 R 3 0.1 0:03.40 htop
So, using a GbE USB adaptor, you can get up to 240Mbps (one-way) using USB 2.0 if your CPU is fast enough.
I believe the Pi's CPU will be the bottleneck, not the actual USB port.
[EDIT] After reading SirLagz's comment on Pi's USB stack, it could just as well be the culprit for the high CPU usage, leading to a lower throughput. Anyway, I wouldn't expect anything near 114Mbps using TCP, but it's probably still better than using wireless.
Regards.