From 75662469a1e030a7650d77a576190e0eec474cae Mon Sep 17 00:00:00 2001 From: bt90 Date: Tue, 23 Apr 2024 22:28:14 +0200 Subject: [PATCH] increase send and receive buffer size to 7 MiB (#4455) This increases throughput on high-bandwidth connections. 7 MB is the value that WireGuard uses, see https://github.com/WireGuard/wireguard-go/commit/f26efb65f23acbd88785d1ae793fa3264c999673 for details. --- internal/protocol/params.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/protocol/params.go b/internal/protocol/params.go index 487cbc06..a08deeaa 100644 --- a/internal/protocol/params.go +++ b/internal/protocol/params.go @@ -3,10 +3,10 @@ package protocol import "time" // DesiredReceiveBufferSize is the kernel UDP receive buffer size that we'd like to use. -const DesiredReceiveBufferSize = (1 << 20) * 2 // 2 MB +const DesiredReceiveBufferSize = (1 << 20) * 7 // 7 MB // DesiredSendBufferSize is the kernel UDP send buffer size that we'd like to use. -const DesiredSendBufferSize = (1 << 20) * 2 // 2 MB +const DesiredSendBufferSize = (1 << 20) * 7 // 7 MB // InitialPacketSizeIPv4 is the maximum packet size that we use for sending IPv4 packets. const InitialPacketSizeIPv4 = 1252