On 2020-05-06, Jordan Geoghegan <jor...@geoghegan.ca> wrote: > > > On 2020-05-04 06:42, Kalle Kadakas wrote: >> Greetings OpenBSD community, >> >> I am running into severe bandwidth limitations whilst passing traffic >> through an OpenBSD firewall. >> The NIC in use is an Intel 10Gb 2-port X520 adapter from which I would >> hope to pass through at least 7Gbps+, yet the best results I have >> gotten is only around 3.5Gbps. >> >> The results of bandwidth measurements (iperf for 30sec... >> > > As has been discussed on misc previously, iperf is not suitable for > benchmarking networking throughput on OpenBSD. It ends up just > benchmarking the gettimeofday syscall (something that is cheap on Linux, > but relatively expensive on OpenBSD I'm told).
clock_gettime. It's iperf3 that calls this often; iperf not so much. But when testing with default options, you may see higher numbers from iperf3: the direct comparison isn't fair though because it uses 128K TCP buffers by default, whereas iperf uses the OS default. On Linux clock_gettime often doesn't use a system call, on OpenBSD it does (and with some of the mitigations for cpu bugs, system calls are more expensive than they used to be). > For best results, use tcpbench for your OpenBSD networking benchmarks. For accurate results of packet forwarding performance, use fast packet sources/sinks running whatever OS either side of an OpenBSD router.