Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP-Receive-Buffer-Size #3024

Closed
web-http3 opened this issue Jan 25, 2021 · 3 comments
Closed

UDP-Receive-Buffer-Size #3024

web-http3 opened this issue Jan 25, 2021 · 3 comments

Comments

@web-http3
Copy link

web-http3 commented Jan 25, 2021

uname -a
Linux hostname 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

sysctl -a | grep net.core.wmem_max

net.core.wmem_max = 25000000

Even with the above setting, the following message still occurs in /var/log/syslog. Which part should I check?
caddy server 2.3.0

/var/log/syslog

caddy[20950]: 2021/01/26 06:23:44 connection doesn't allow setting of receive buffer size. See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.

As of quic-go v0.19.x, you might see warnings about the receive buffer size.

Experiments have shown that QUIC transfers on high-bandhwidth connections can be limited by the size of the UDP receive buffer. This buffer holds packets that have been received by the kernel, but not yet read by the application (quic-go in this case). Once this buffer fills up, the kernel will drop any new incoming packet.

Therefore, quic-go tries to increase the buffer size. The way to do this is an OS-specific, and we currently have an implementation for linux, windows and darwin. However, an application is only allowed to do increase the buffer size up to a maximum value set in the kernel. Unfortunately, on Linux this value is rather small, too small for high-bandwidth QUIC transfers.

It is recommended to increase the maximum buffer size by running:

sysctl -w net.core.rmem_max=2500000
This command would increase the maximum receive buffer size to roughly 2.5 MB.

@marten-seemann
Copy link
Member

See https://github.com/lucas-clemente/quic-go/blob/7456e643b9568ee1e1a5bea3d3d165051e8deaf0/packet_handler_map.go#L59-L62

This happens if the connection is not a *net.UDPConn, but a generic net.PacketConn.

@francislavoie
Copy link

FYI @marten-seemann this is about Caddy, see the thread: https://caddy.community/t/udp-receive-buffer-size-quic/11244

@marten-seemann
Copy link
Member

This is a Caddy issue, see caddyserver/caddy#3998.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants