Iperf shows different speeds between two raspberries

I have two raspberries, RPIB with raspbian as an OS (pi user), and RPI2 wih osmc as an OS (osmc user).

I have made two tests.
The first test is iperf server on RPI2 and client on RPIB.

osmc@osmc:~$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.5.50 port 5001 connected with 192.168.5.60 port 58922
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  53.9 MBytes  45.0 Mbits/sec

pi@raspberrypi:~ $ iperf -c 192.168.5.50
------------------------------------------------------------
Client connecting to 192.168.5.50, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.5.60 port 58922 connected with 192.168.5.50 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  53.9 MBytes  45.0 Mbits/sec

If I swithc the sides I get different results:

pi@raspberrypi:~ $ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.5.60 port 5001 connected with 192.168.5.50 port 49726
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  97.8 MBytes  81.6 Mbits/sec


osmc@osmc:~$ iperf -c 192.168.5.60
------------------------------------------------------------
Client connecting to 192.168.5.60, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.5.50 port 49726 connected with 192.168.5.60 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  97.8 MBytes  81.9 Mbits/sec

I have executed tests several times and result is always the same.
Can someone explain the difference in the speed?

Original Raspberry Pi 1 ?

Kodi is running on OSMC during the test ?

If so, that is why. The mere act of having Kodi running on a Pi 1 consumes enough CPU time to drop Ethernet throughput to about half of the maximum possible. The Pi 1 just has a really slow CPU.

Try stopping Kodi then re-run your test:

sudo systemctl stop mediacenter

Also if you are really trying to directly compare the performance of the two Pi’s you should not be testing between them but to a 3rd much faster machine such as a PC. Otherwise you are testing the sending performance of one Pi at the same time as the receiving performance of the other and vica versa - you will not be able to get meaningful results by doing that as you will not know which Pi is causing the issue.

1 Like

After stopping kodi on osmc (192.168.5.50) the results are still disbalanced.

raspbian server

root@raspberrypi:/home/pi# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.5.60 port 5001 connected with 192.168.5.50 port 45372
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.1 sec  89.0 MBytes  74.1 Mbits/sec
[  5] local 192.168.5.60 port 5001 connected with 192.168.5.50 port 45374
[  5]  0.0-10.0 sec  97.6 MBytes  81.5 Mbits/sec
[  4] local 192.168.5.60 port 5001 connected with 192.168.5.50 port 45376
[  4]  0.0-10.0 sec  95.8 MBytes  80.0 Mbits/sec

osmc client

root@osmc:/home/osmc# iperf -c 192.168.5.60
------------------------------------------------------------
Client connecting to 192.168.5.60, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.5.50 port 45372 connected with 192.168.5.60 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  89.0 MBytes  74.5 Mbits/sec
root@osmc:/home/osmc# iperf -c 192.168.5.60
------------------------------------------------------------
Client connecting to 192.168.5.60, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.5.50 port 45374 connected with 192.168.5.60 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  97.6 MBytes  81.9 Mbits/sec
root@osmc:/home/osmc# iperf -c 192.168.5.60
------------------------------------------------------------
Client connecting to 192.168.5.60, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.5.50 port 45376 connected with 192.168.5.60 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  95.8 MBytes  80.2 Mbits/sec
root@osmc:/home/osmc#

osmc server

root@osmc:/home/osmc# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.5.50 port 5001 connected with 192.168.5.60 port 59546
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  53.6 MBytes  44.8 Mbits/sec
[  5] local 192.168.5.50 port 5001 connected with 192.168.5.60 port 59547
[  5]  0.0-10.0 sec  53.4 MBytes  44.6 Mbits/sec
[  4] local 192.168.5.50 port 5001 connected with 192.168.5.60 port 59548
[  4]  0.0-10.1 sec  53.5 MBytes  44.6 Mbits/sec

respbian client

root@raspberrypi:/home/pi# iperf -c 192.168.5.50
------------------------------------------------------------
Client connecting to 192.168.5.50, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.5.60 port 59546 connected with 192.168.5.50 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  53.6 MBytes  44.9 Mbits/sec
root@raspberrypi:/home/pi# iperf -c 192.168.5.50
------------------------------------------------------------
Client connecting to 192.168.5.50, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.5.60 port 59547 connected with 192.168.5.50 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  53.4 MBytes  44.6 Mbits/sec
root@raspberrypi:/home/pi# iperf -c 192.168.5.50
------------------------------------------------------------
Client connecting to 192.168.5.50, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.5.60 port 59548 connected with 192.168.5.50 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  53.5 MBytes  44.7 Mbits/sec
root@raspberrypi:/home/pi#

While on osmc media center is stil down rsync confirms the speed difference.

from raspbian to the osmc, external hdd to external hdd

root@raspberrypi:# rsync -aPhv tails-i386-2.0.iso osmc@192.168.5.50:/mnt/wde4tb/za_brisati
sending incremental file list
tails-i386-2.0.iso
          1.14G 100%    2.34MB/s    0:07:42 (xfr#1, to-chk=0/1)

sent 1.14G bytes  received 35 bytes  2.45M bytes/sec
total size is 1.14G  speedup is 1.00

from osmc to the raspbian, external hdd to external hdd

root@osmc:/mnt/wde4tb/za_brisati# rsync -aPhv tails-i386-2.0.iso pi@192.168.5.60:/mnt/wdg2tb/obrisi
sending incremental file list
tails-i386-2.0.iso
          1.14G 100%    1.79MB/s    0:10:03 (xfr#1, to-chk=0/1)

sent 1.14G bytes  received 35 bytes  1.85M bytes/sec
total size is 1.14G  speedup is 1.00

On both raspberries RPI1 (raspbian) and RPI2 (osmc) I have installed samba. I have copied the same file 1.05 GB from raspbian to my laptop (windows 10) which was at approximatelly speed 4.15 MB/s. The same file from osmc to laptop was copied at average speed 5.30 MB/s.

I really don’t get it. :confused:

What sort of switch are your Pi’s connected to ? Is it a managed or unmanaged switch ?

If it is a managed switch do you have Ethernet flow control enabled or disabled on the ports the Pi’s are connected to ?

Try either enabling flow control on the switch ports the Pi’s are connected to, or add the following option to /boot/cmdline.txt:

smsc95xx.turbo_mode=Y