Hacker News new | past | comments | ask | show | jobs | submit login

> Even though your disk read is a memory read in all likelihood given how filesystem caching works, it's still an IO call, which isn't free.

I wonder if io_uring could be used to issue a single syscall that would read data from disk (actually using page cache) and send it on the network.

Of course, you could use DPDK or similar technologies to do the opposite - read the data from disk once and keep it in user-space buffers, then write it directly to NIC memory without another syscall. That should still theoretically be faster, since there would be 0 syscalls per request, where the other approach would require 1 per request.




> I wonder if io_uring could be used to issue a single syscall that would read data from disk (actually using page cache) and send it on the network.

Only if you don't care about HTTP/2 and TLS. And if you don't care about those, you can as well do sendfile() from a thread.


You can do kernel TLS for sendfile at least, maybe for io_uring too? Probably not for HTTP/2, but I'm not convinced multiplexed tcp in tcp is a good protocol for the public internet anyway.


That's indeed possible, if one has a TLS stack which supports KTLS. I however don't think there's not too many of those yet, and probably even less so in Rust where both the library and a potential Rust wrapper would need to support it.


My site does serve itself out of a UNIX socket, so sendfile() may actually work. But most of the data is served with handler functions though.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: