Re: slow network performance in bhyve with freebsd guests compared with any other guest os

From: Lexi Winter <lexi_at_le-fay.org>
Date: Sun, 29 Sep 2024 07:12:23 UTC
On 29/09/2024 07:58, void wrote:
> Surprisingly, freebsd guest performance is about 1/3rd of the line speed.
> Do some sysctls need to be tuned in freebsd specifically for when it is 
> in a guest context?

i tested this here and cannot reproduce the problem:

1023!ragweed ~% iperf3-darwin -c iris.eden.le-fay.org
Connecting to host iris.eden.le-fay.org, port 5201
[ 18] local 2001:8b0:aab5:c110:ab:f106:1d40:4841 port 57426 connected to 
fd12:8247:3:1::7 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd 
  RTT
[ 18]   0.00-1.00   sec   953 MBytes  7.99 Gbits/sec    0   4.00 MBytes 
  1ms
[ 18]   1.00-2.00   sec  1.15 GBytes  9.87 Gbits/sec    0   4.00 MBytes 
  1ms
[ 18]   2.00-3.00   sec  1.15 GBytes  9.87 Gbits/sec    0   4.00 MBytes 
  2ms
[ 18]   3.00-4.00   sec  1.15 GBytes  9.87 Gbits/sec    0   4.00 MBytes 
  2ms
[ 18]   4.00-5.00   sec  1.13 GBytes  9.67 Gbits/sec    0   4.00 MBytes 
  1ms
[ 18]   5.00-6.00   sec  1.15 GBytes  9.87 Gbits/sec    0   4.00 MBytes 
  2ms
[ 18]   6.00-7.00   sec  1.14 GBytes  9.82 Gbits/sec    0   4.00 MBytes 
  1ms
[ 18]   7.00-8.00   sec  1.15 GBytes  9.87 Gbits/sec    0   4.00 MBytes 
  1ms
[ 18]   8.00-9.00   sec  1.15 GBytes  9.85 Gbits/sec   46   3.35 MBytes 
  1ms
[ 18]   9.00-10.00  sec  1.15 GBytes  9.87 Gbits/sec    0   3.44 MBytes 
  1ms
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[ 18]   0.00-10.00  sec  11.2 GBytes  9.66 Gbits/sec   46             sender
[ 18]   0.00-10.00  sec  11.2 GBytes  9.65 Gbits/sec 
receiver

iperf Done.
1023!ragweed ~%

client is macOS, server is FreeBSD 15.0 bhyve guest, VM host is FreeBSD 
15.0 on Ryzen 7 2700X with ix(4) network card, path MTU is 9000.  as you 
can see, it reached close enough to wire speed.

i tested with 1500 MTU and it managed ~4Gbps, which is not great, but 
around what i'd expect (and a lot faster than your test manages).

i am not using tcp_rack or any other TCP stack non-default options.

	regards, liss.