-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
investigate modifying the kernel's receive buffer size #2255
Comments
https://golang.org/pkg/net/#UDPConn.SetReadBuffer should do the trick. It's implemented as a setsockopt SO_RCVBUF syscall under the hood. |
The buffer sizes can be queried by running sysctl net.core.rmem_default
sysctl net.core.rmem_max On the Linux system I'm testing on, both values are 212992. When querying the receive buffer from quic-go using syscall.GetsockoptInt(int(fd.Fd()), syscall.SOL_SOCKET, syscall.SO_RCVBUF) I get the same value. Using While doubling this value is nice (and leads to speedup of ~2x in my test), I'd like to increase it even further. As far as I can see, we'd need to ask people to run sysctl -w net.core.rmem_max=xxx in order to increase the maximum value though. |
Yup, the default Linux kernel UDP receive buffer sizes are fairly small. Applications can only set the receive buffer size up to the limit specified by the kernel. The app can read back the buffer size however, and warn the use if the requested buffer size less than desired. |
Shoud |
The BDP has nothing to do with this. The problem is how fast (and consistently) we’re able to read packet from the socket. We need to do that faster than the bandwidth of the connection, the RTT is completely irrelevant for this. |
The linux kernel also provide the ability to config |
It turns out that the Linux kernel's UDP receive buffer is too small by default (around 200k). In order to support higher bandwidths, we need a significantly higher value.
It would be good if we could set this on a per-connection basis. Not sure if Go allows us to do this.
The text was updated successfully, but these errors were encountered: