alibaba / PhotonLibOS

Probably the fastest coroutine lib in the world!

Home Page:https://PhotonLibOS.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Socket recv_errqueue:deferred copy occurs message

aley1 opened this issue · comments

commented

Hi,

I will like to know what this message means: "PhotonLibOS-main/net/basic_socket.cpp:287|recv_errqueue:deferred copy occurs, might harm performance" and the reason it appears.

I am testing tcp_socket_server / tcp_socket_client vs zerocopy_tcp_server/zerocopy_tcp_client with / without TLS

  1. I am getting the 'deferred copy occurs' message when using either tcp or zerocopy_tcp.
  • One message on the client and one message on the server.
  • During the connection there is one stream->send and one stream->write
  1. When TLS is used, I get 4 'deferred copy occurs' messages on client and 4 times on server

Also, are there plans to support TLS 1.3?

Thanks.

https://docs.kernel.org/networking/msg_zerocopy.html#deferred-copies

This is a hint for you that your message has been actually copied.

According to my observation, if you are monitoring the net interface by iftop, you are likely to get that message from kernel.

FYI,

  1. io_uring socket also has the zerocopy send.
  2. zerocopy send only has benefit if your packet is large ( > 16KB)., and your NIC having large bandwidth (which usually means lower latency)

I'll ask my teams first for the TLS. And what is the core feature you want from TLS 1.3?

commented

I'll ask my teams first for the TLS. And what is the core feature you want from TLS 1.3?

I believe TLS 1.3 is twice as fast for handshake than TLS 1.2 since its one round trip instead of two. Also it has a feature where it 'remembers' the handshake for previous endpoint it has connected to so no need to have handshake again. This really helps for HTTPS connections which I am planning to implement as well.

I'm afraid that right now we don't have plans for TLS 1.3. If you can contribute some code in net/security-context/tls-stream.cpp, it would be appreciated.

TLS 1.3 has changed API, and it seems incompatible with libcurl.