trafficserver
trafficserver copied to clipboard
Add recvmmsg(2)/sendmmsg(2) support on UDP layer
The recvmmsg() system call is an extension of recvmsg(2) that allows the caller to receive multiple messages from a socket using a single system call.
The sendmmsg() system call is an extension of sendmsg(2) that allows the caller to transmit multiple messages on a socket using a single system call.
These have performance benefits for UDP/QUIC. It'd be grate if ATS can use these on some platforms which support these system calls.
Note: The recvmmsg()
and sendmmsg()
is Linux-specific.
VERSIONS
The recvmmsg() system call was added in Linux 2.6.32. Support in glibc was added in version 2.12.
VERSIONS
The sendmmsg() system call was added in Linux 3.0. Support in glibc was added in version 2.14.
Actually FreeBSD 11.0 supports them.
HISTORY
The recv() function appeared in 4.2BSD. The recvmmsg() function appeared
in FreeBSD 11.0.
https://www.freebsd.org/cgi/man.cgi?query=recvmmsg&manpath=FreeBSD+11.0-RELEASE https://www.freebsd.org/cgi/man.cgi?query=sendmmsg&manpath=FreeBSD+11.0-RELEASE
How about the Mac OS X and macOS ?
macOS doesn't, as far as I know. However, I don't think that will be a reason to not use *mmsg()
. In my opinion, we should use native *mmsg()
and create compatible functions for platforms which don't have them.
At QUIC Hackathon in Tokyo, we agreed to use recvmmsg()
. But @oknet concerns about using sendmmsg()
for packet lost.
Update: It seems like we can use recvmsg_x
on macOS.
@masaori335 is this still an issue?
Right. This is a TODO of QUIC project.
So this only impacts QUIC not DNS?
I haven't seen any discussion about how we do this yet. I'm not sure if it's good or bad for DNS, but I'd use recv/sendmmsg for the both if there's no objection.
I'm working on this.
sendmmsg was supported. recvmmsg is not yet.
closed by https://github.com/apache/trafficserver/pull/9905