Consider increasing OS send socket buffer (`SO_SNDBUF`)
For increased performance, we might want to increase the OS UDP socket send and receive buffer.
See also:
- https://man7.org/linux/man-pages/man7/socket.7.html
SO_SNDBUFSO_RCVBUF
- https://github.com/google/quiche/blob/95857ee25d30c1dc09f1c36cbe7a29b969a11f6d/quiche/quic/core/quic_udp_socket_posix.inc#L195
- https://github.com/quic-go/quic-go/blob/8f1110450bad0b41f8dd03ea8cf24c299a9c9a20/sys_conn_helper_linux.go#L35
- https://github.com/quinn-rs/quinn/blob/693c9b7cfbf89c541ba99523237594499984ffed/README.md#usage-notes
Are we currently running with the OS defaults? What do other stacks use?
Are we currently running with the OS defaults?
In Firefox we attempt to set it to 1 MiB. I wasn't aware of this until today trying to add another pref.
# Receive buffer size of QUIC socket
- name: network.http.http3.recvBufferSize
type: RelaxedAtomicInt32
value: 1048576
mirror: always
https://searchfox.org/mozilla-central/rev/01aaa47e62a2015e7641f26ab0bc2bb00ab579b8/modules/libpref/init/StaticPrefList.yaml
Thanks for finding this out. We could do the same in neqo, but would it be worth it?
Do we also do something for the send buffer?
As far as I can tell we only alter the receive buffer, not the send buffer. I am not familiar enough with the code base to know for sure.
We could do the same in neqo, but would it be worth it?
:+1: worth experimenting with in neqo-server and neqo-client.
I think we should – both in Firefox and neqo – bump the RX and TX buffers up. On TX, it should reduce the "would block" occurrences, and on RX it might reduce drops-in-the-stack.
Keeping this open to track send buffer increase experimentation.