Re:Serving Netflix Video at 400Gb/s on FreeBSD [pdf]
by Thaxll on Sunday September 19, 2021 @06:02PM
(#28588364)
sendfile() with splice and io_uring is similar? I know that this is very experimental on Linux.
The overall idea is to copy bytes from disk to the socket with almost no allocation and not blocking, this is the idea right?
Re:Serving Netflix Video at 400Gb/s on FreeBSD [pdf]
by Matthias247 on Sunday September 19, 2021 @07:10PM
(#28588815)
Maybe. A few things in io-uring are implemented by letting a kernel task/thread block on doing the actual work. Which calls that are seems to change in every version, and might be tricky to find out without reading the kernel code.
The gist is that the sendfile() call stages the pages waiting to be read in the socket buffer, and marks the mbufs with M_NOTREADY (so they cannot be sent by TCP). When the disk read completes, a sendfile callback happens in the context of the disk ithread. This clears the M_NOTREADY flag and tells TCP they are ready to be sent. See https://www.nginx.com/blog/nginx-and-netflix-contribute-new-...