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
f26efb65f2
for details.
This commit is contained in:
bt90
2024-04-23 22:28:14 +02:00
committed by GitHub
parent 6a4512a6f0
commit 75662469a1

View File

@@ -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