iperf3 in docker container not showing 10Gb/sec speed

Hi,

I have RB5009UG+S+IN router and CRS309-1G-8S+IN 10Gb/sec switch.

I have setup a docker container on the RB5009 router with iperf3.

However, I am still only getting a maximum of around 3.00 Gbits/sec when connecting from my windows 10Gb/sec network card with iperf3 in dos window.

It was my understanding that CRS309-1G-8S+IN can switch at 10Gb/sec on ALL ports, and RB5009UG+S+IN router can handle 10Gb/sec across its SFP+ port.

I have replaced the fibre card on my windows PC, I have replaced the fibre DAC from windows PC to the switch, and I have replaced the short DAC from router to switch - still no luck.

Please can someone advise what the problem might be?

c:\Program Files\iperf3>iperf3 -c 172.17.1.2
Connecting to host 172.17.1.2, port 5201
[  5] local 192.168.1.43 port 50698 connected to 172.17.1.2 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   355 MBytes  2.98 Gbits/sec
[  5]   1.00-2.00   sec   365 MBytes  3.06 Gbits/sec
[  5]   2.00-3.00   sec   357 MBytes  3.00 Gbits/sec
[  5]   3.00-4.00   sec   364 MBytes  3.05 Gbits/sec
[  5]   4.00-5.00   sec   362 MBytes  3.04 Gbits/sec
[  5]   5.00-6.00   sec   293 MBytes  2.46 Gbits/sec
[  5]   6.00-7.00   sec   282 MBytes  2.37 Gbits/sec
[  5]   7.00-8.00   sec   312 MBytes  2.62 Gbits/sec
[  5]   8.00-9.00   sec   322 MBytes  2.71 Gbits/sec
[  5]   9.00-10.00  sec   337 MBytes  2.83 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  3.27 GBytes  2.81 Gbits/sec                  sender
[  5]   0.00-10.00  sec  3.27 GBytes  2.81 Gbits/sec                  receiver

Router config:

# 2024-03-25 06:58:49 by RouterOS 7.11
# software id = **ELIDED**
#
# model = RB5009UG+S+
# serial number = **ELIDED**
/interface bridge
add name=LAN-bridge
add name=containers
/interface veth
add address=172.17.0.2/24 gateway=172.17.0.1 gateway6="" name=veth1
/container mounts
add dst=/etc/pihole name=etc_pihole src=/usb1-part1/etc
add dst=/etc/dnsmasq.d name=dnsmasq_pihole src=/usb1-part1/etc-dnsmasq.d
/disk
set usb1 type=hardware
add parent=usb1 partition-number=1 partition-offset=512 partition-size=\
    "31 376 706 560" type=partition
/interface list
add name=LAN
add name=WAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool1 ranges=192.168.1.2-192.168.1.254
/ip dhcp-server
add address-pool=dhcp_pool1 interface=LAN-bridge name=dhcp1
/container
add envlist=pihole_envs interface=veth1 mounts=etc_pihole,dnsmasq_pihole \
    root-dir=usb1-part1/pihole start-on-boot=yes
/container config
set registry-url=https://registry-1.docker.io tmpdir=usb1-part1
/container envs
add key=TZ name=pihole_envs value=Europe/London
add key=DNSMASQ_USER name=pihole_envs value=root
/interface bridge port
add bridge=containers interface=veth1
add bridge=LAN-bridge interface=ether3
add bridge=LAN-bridge interface=sfp-sfpplus1
add bridge=LAN-bridge interface=ether4
add bridge=LAN-bridge interface=ether5
add bridge=LAN-bridge interface=ether6
add bridge=LAN-bridge interface=ether7
add bridge=LAN-bridge interface=ether8
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add interface=ether1 list=WAN
add interface=ether2 list=WAN
add interface=sfp-sfpplus1 list=LAN
add interface=ether8 list=LAN
add interface=ether7 list=LAN
add interface=ether6 list=LAN
add interface=ether4 list=LAN
add interface=ether3 list=LAN
add interface=ether5 list=LAN
/ip address
add address=192.168.1.1 interface=LAN-bridge network=192.168.1.1
add address=172.17.0.1/24 interface=containers network=172.17.0.0
/ip dhcp-client
add interface=ether1
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=172.17.0.2 gateway=192.168.1.1
/ip firewall filter
add action=accept chain=input comment="accept established, related" \
    connection-state=established,related
add action=drop chain=input connection-state=invalid
add action=accept chain=input comment="allow ping from LAN" in-interface=\
    LAN-bridge protocol=icmp
add action=accept chain=input comment="allow ping from WAN" \
    in-interface-list=WAN protocol=icmp
add action=drop chain=input comment="block everything else" \
    in-interface-list=WAN
add action=fasttrack-connection chain=forward comment=\
    "fast-track for established, related" connection-state=\
    established,related hw-offload=yes
add action=accept chain=forward comment="accept established, related" \
    connection-state=established,related
add action=drop chain=forward connection-state=invalid
add action=drop chain=forward comment=\
    "drop access to clients behind NAT from WAN" connection-nat-state=!dstnat \
    connection-state=new in-interface=ether1
add action=accept chain=input in-interface=LAN-bridge port=53 protocol=tcp
add action=accept chain=forward in-interface=LAN-bridge port=53 protocol=tcp
add action=accept chain=input in-interface=LAN-bridge port=53 protocol=udp
add action=accept chain=forward in-interface=LAN-bridge port=53 protocol=udp
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat src-address=172.17.0.0/24
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set sip disabled=yes
set pptp disabled=yes
/ip proxy
set enabled=yes
/ip route
add disabled=no distance=1 dst-address=192.168.1.0/24 gateway=LAN-bridge \
    pref-src="" routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add disabled=no distance=2 dst-address=192.168.1.0/24 gateway=sfp-sfpplus1 \
    pref-src="" routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set api disabled=yes
/ip traffic-flow
set interfaces=WAN
/ip upnp
set enabled=yes
/ipv6 nd
set [ find default=yes ] disabled=yes
/system clock
set time-zone-name=Europe/London
/system note
set show-at-login=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN

Switch config:

# 2024-03-24 17:42:56 by RouterOS 7.11
# software id = **ELIDED**
#
# model = CRS309-1G-8S+
# serial number = **ELIDED**
/interface bridge
add admin-mac=**ELIDED** auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether1 ] auto-negotiation=no
set [ find default-name=sfp-sfpplus1 ] auto-negotiation=no speed=10Gbps
set [ find default-name=sfp-sfpplus2 ] auto-negotiation=no speed=10Gbps
set [ find default-name=sfp-sfpplus3 ] auto-negotiation=no speed=10Gbps
set [ find default-name=sfp-sfpplus4 ] auto-negotiation=no speed=10Gbps
set [ find default-name=sfp-sfpplus5 ] auto-negotiation=no
set [ find default-name=sfp-sfpplus6 ] auto-negotiation=no
set [ find default-name=sfp-sfpplus7 ] auto-negotiation=no speed=2.5Gbps
set [ find default-name=sfp-sfpplus8 ] auto-negotiation=no speed=2.5Gbps
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/port
set 0 name=serial0
/interface bridge port
add bridge=bridge comment=defconf interface=ether1
add bridge=bridge comment=defconf interface=sfp-sfpplus1
add bridge=bridge comment=defconf interface=sfp-sfpplus2
add bridge=bridge comment=defconf interface=sfp-sfpplus3
add bridge=bridge comment=defconf interface=sfp-sfpplus4
add bridge=bridge comment=defconf interface=sfp-sfpplus5
add bridge=bridge comment=defconf interface=sfp-sfpplus6
add bridge=bridge comment=defconf interface=sfp-sfpplus7
add bridge=bridge comment=defconf interface=sfp-sfpplus8
/interface list member
add interface=ether1 list=LAN
add interface=sfp-sfpplus1 list=LAN
add interface=sfp-sfpplus2 list=LAN
add interface=sfp-sfpplus3 list=LAN
add interface=sfp-sfpplus4 list=LAN
add interface=sfp-sfpplus5 list=LAN
add interface=sfp-sfpplus6 list=LAN
add interface=sfp-sfpplus7 list=LAN
add interface=sfp-sfpplus8 list=LAN
/ip dhcp-client
add interface=bridge
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=sfp-sfpplus2 \
    pref-src="" routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add disabled=no distance=1 dst-address=172.17.0.2/32 gateway=sfp-sfpplus2 \
    pref-src="" routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
/ip upnp
set enabled=yes
/system note
set show-at-login=no
/system routerboard settings
set auto-upgrade=yes boot-os=router-os

More info about my network is here: https://davidcraddock.net/my-home-network/

Thanks!

According to my understainding of official test results for RB5009 (and many other long-time forum members’ understanding as well) it can route in real life at around 3Gbps (give or take). Running a (CPU intensive) app inside container on same router, competing for same CPU resources, means that your use case is more on “… or take” side of stated number.

So I guess what you see is what your RB is capable of in your usage scenario.

I second what @mkx said, as that echoes my experience. You’ve hit the limit of what the quad-core CPUs’ can handle on RB5009, RB4011, and CCR2004. The ports are fine, and if you’re able to come up with a scenario where you’re just switching or bridging, then more of it hits the hardware. But speed testing, especially in a container, is definitely CPU-bound.

Thanks! I appreciate the insight

May I ask, whose?

Mine is capable of better than that with an RB4011, and an RB5009 should do a smidge better still. See the benchmark results at the bottom of the linked documentation.

Partly that’s the low-overhead nature of the setup, but also it’s careful setup of the test. The most significant factors are using a number of parallel test threads (-P) equal to the core count, “reverse” (-R) mode, and use of iperf3 3.16, which improves handling of parallel threads considerably over earlier versions.


It was my understanding that CRS309-1G-8S+IN can switch at 10Gb/sec on ALL ports

It can…if you run “iperf3 -s” on a sufficiently dialed-in server connected to one of those 10G ports and run “iperf3 -c” on an equally dialed-in client machine, so that the CRS309 runs in pure switch-chip mode, not running anything through the CPU. I’ve gotten 9.4 Gbit/sec results across a CRS328 that way.

When you put the iperf3 container on either of these inexpensive RouterOS boxes instead, iperf3 must do everything using that same CPU, by necessity, and there’s only so much it can do with a few ARM cores in the Cortex A class.

Thank you. I have put an item on my todo list to try your docker container and your testing method and will report back ASAP.

I’m still only getting 3-4gbits/sec across the switch.. isn’t that a bit weird?

https://davidcraddock.net/my-home-network/

Server → Studio PC is just via the Switch only. This is with Ubuntu’s 22.04 repos iperf3.

First rule of troubleshooting: test one thing at a time. You’ve got several unnecessary complexities in this setup:


  • Two fiber links to the Home Server in the lower left corner of the network diagram. Unplug one to give the switch exactly one option to choose when forwarding traffic. (I’m not telling you that link aggregation is bad, merely that we’re testing single-link performance here. If you want a LAGG test, you’d do that separately after getting single-link working, and then with a second host that is also set up for dual-link.)
  • ZeroTier. Turn that off. You don’t need packets going up to the Internet and back down merely to get across the house due to mistaken routing.
  • “Fiber DAC”, really, across whole-house distances? Even an active DAC cable might be limited to 10m; passive, less. Unless you’re living in an open-plan shoebox apartment and can therefore do straight-line cable runs, you’ve either chosen the wrong tech or your diagram is wrong. The proper choice here is SFP+ transceivers with dumb fiber cabling. I’d go with OM3 or OM4 MMF.

Then with all of that fixed, you might still have problems, as “Server” and “Studio PC” tells me nothing about how capable those are of sourcing/sinking 10G of traffic continually. By “dialed-in” above, I mean you need quality NICs, good cabling, and a CPU powerful enough to drive it all.

Yes, CPU, and for the same reason as our ARM comments above.

Thank you for your detailed reply.

Two fiber links to the Home Server in the lower left corner of the network diagram. Unplug one to give the switch exactly one option to choose when forwarding traffic. (I’m not telling you that link aggregation is bad, merely that we’re testing single-link performance here. If you want a LAGG test, you’d do that separately after getting single-link working, and then with a second host that is also set up for dual-link.)

Hi, that is actually not the case now I just have one fibre link, need to update the diagram

ZeroTier. Turn that off. You don’t need packets going up to the Internet and back down merely to get across the house due to mistaken routing.

I did actually turn it off for the purpose of the tests.

“Fiber DAC”, really, across whole-house distances? Even an active DAC cable might be limited to 10m; passive, less. Unless you’re living in an open-plan shoebox apartment and can therefore do straight-line cable runs, you’ve either chosen the wrong tech or your diagram is wrong. The proper choice here is SFP+ transceivers with dumb fiber cabling. I’d go with OM3 or OM4 MMF.

I do actually live in the UK where the house size is quite a bit smaller than the US. I have 10m Fibre DAC cables connecting the upstairs study with the downstairs studio.

I am using these NICs - https://www.amazon.co.uk/dp/B01GHTXHMK
and this DAC to connect the server to the switch - https://www.amazon.co.uk/gp/product/B01MYMK4GT/

My computers are pretty powerful.. plenty capable to source/sink 10G of traffic I would have thought.. server is 2012 era Intel Xeon 8 CPU with 32GB DDR ram running Ubuntu - a Lenovo Thinkstation C 30, Studio PC is 2020 12 gen Intel i7 CPU with 16GB DDR4 RAM running Windows 11.

I was previously using a Mellonex network card in the server and was getting comparable speeds - I switched that out, so I’m pretty sure it’s not the NIC.

The only thing that I can think of that MIGHT be causing a problem and might need to be replaced is the 10m DAC from server to switch.. if you have any recommendations of high quality 10m DACs I’d be very interested.

I suppose it might also be the PCI express lanes on my 2012 motherboard.. I would have thought they were more than capable of handling 5Gb/sec though at least.

That looks like your problem to me. I wasn’t in the 10G market in 2012, but I don’t remember anything “workstation” grade coming with 10G NICs, not even the top-end Mac Pro. That didn’t start happening until 2016-2017.


PCI express lanes on my 2012 motherboard..more than capable of handling 5Gb/sec

The 10GTek product page doesn’t specify a PCIe version, so we have to assume PCIe 1.0, where the total transfer is around 16Gbit/sec for 8 lanes, but that includes your graphics card and whatever else is on that shared bus. You’re right on the ragged edge here, if it’s possible at all.

Stupid question, but whats your MTU? to get ~10g routed traffic on my 2004 i have to turn the MTU up to around 8k, as well as run multiple TCP connections of iperf in parallel.

p.s. instead of multiple TCP connections you could also use an appropriate congestion control algorithm like https://github.com/apernet/tcp-brutal :laughing:

Across the OP’s CRS309, standard-sized Ethernet packets suffice, if we can go by my CRS328 tests here. I have yet to be able to justify jumbo packets with any test I’ve been able to devise here. That’s not to say it isn’t useful somewhere, but that I think people too often reach for this solution as an easy thing to try and then leave it enabled without first finding out if it actually helped.


TCP brutal

OP specified Windows on both ends up-thread.

In any case, how does congestion control adjustment help on a point-to-point test, on an idle link? Regular TCP will asymptotically approach the link’s maximum data rate, then settle in. I don’t see a change here helping unless you’re wanting shorter iperf3 runs than the default of 10 seconds.

If you’re still worried about it, run the test up to 30 seconds. I’d expect that to swamp any congestion control algorithm differences in a test like the one discussed here.

well well, then forget my practical advise and continue with your professional support, pointing at pcie links xD
If you haven’t gotten it, the congestion control point was not very serious.
kthxby