loopback: Bump default MTU from 16KiB to 64KiB

While profiling with iperf for #18203 I noticed that the default MTU for
the loopback interface is 16KiB. Other operating systems set this quite
a bit higher. Linux sets it to 64KiB by default. Random Google searches
seem to suggest that Microsoft sets it even higher than this although I
don't have a Windows computer to verify this at the moment.

Changing the default to 64KiB in this patch makes a pretty big
difference in a kvm VM with a single CPU. The max throughput goes from
about 2Mbps/s to around 12Mbps/s, around a 6x increase.

With the same VM but 8 CPUs, the throughput goes from 1.58Gbps to
1.99Gbps, about a 26% increase in throughput. It seems the throughput
is a little more stable too and doesn't drop periodically. I suspect
that this is just because there is less CPU saturation in the loop
consumer thread.

With window size maxed out to around 1GiB as described in #15886 there
is still about a 10% increase in throughput with this change.

There are still some weird performance issues to diagnose but this seems
like a better default.

Change-Id: I8c5d088298a4a7b3e8b1aa1a2f4f85b0cc9c62c2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6000
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Kyle Ambroff-Kao
2023-01-15 05:34:08 +00:00
parent 07f11ccca9
commit fb0b77979a
@@ -59,7 +59,7 @@ loopback_init(const char *name, net_device **_device)
strcpy(device->name, name);
device->flags = IFF_LOOPBACK | IFF_LINK;
device->type = IFT_LOOP;
device->mtu = 16384;
device->mtu = 65536;
device->media = IFM_ACTIVE;
*_device = device;