From fb0b77979a48432f8980ff34d1644714e4526549 Mon Sep 17 00:00:00 2001 From: Kyle Ambroff-Kao Date: Sat, 14 Jan 2023 20:05:05 -0800 Subject: [PATCH] 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 --- src/add-ons/kernel/network/devices/loopback/loopback.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add-ons/kernel/network/devices/loopback/loopback.cpp b/src/add-ons/kernel/network/devices/loopback/loopback.cpp index e7578f0f03..de3024c851 100644 --- a/src/add-ons/kernel/network/devices/loopback/loopback.cpp +++ b/src/add-ons/kernel/network/devices/loopback/loopback.cpp @@ -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;