[quic] Why use sendmsg in loop instead of sendmmsg

Vladimir Homutov vl at nginx.com
Wed Feb 9 11:36:31 UTC 2022


On Wed, Feb 09, 2022 at 06:51:26AM +0000, Gao,Yan(媒体云) wrote:
> HI
>    ngx_quic_create_datagrams use sendmsg in loop when without gso. Can use sendmmsg directly?

there are some reasons we don't do it:

first, attempt to send multiple packets at once makes the code more
complex, especially when you have to deal with multiple encryption levels.
Typically, this is an initial stage of the connection (i.e. handshake)
and you won't get much performance boost from sending multiple packets
at once. That's why we switch to GSO only for application-level packets.

second, sendmmsg() (while being useful) still doesn't provide breakthrough
performance gain. Probably, it would be beneficial to have sendmmsg()
support as well, but currently this is not a top priority.




More information about the nginx-devel mailing list