187 points · by jxub · 8y ago · 51 comments
This is amazing work!
What appeals to me is the Lua integration. I'd love for a Lua application server to become widely available. The http servers out there now don't really fit the bill for (Xavante, Luvit for example).
> Small disk footprint: x86-64 executable has 110KiB (~52KiB if packed with UPX)
> No copies between kernel and userland for files larger than 16KiB
Looks perfect for embedded stuff (and generally impressive).
It needs a separate TLS terminator, though.
TLS is hard given the current architecture, but I've been investigating kTLS, so maybe it'll happen someday. I would appreciate help on this front, though.
I don't know how portable it is yet though
I'd like to use BearSSL, which is a nice, clean implementation of TLS, makes no memory allocation (so it fits Lwan architecture very well)... but only for the initial connection handshake; I'd then hand over TLS to the Linux kernel with kTLS (https://netdevconf.org/1.2/papers/ktls.pdf). However, there's not much beyond some tests in that front.
Previously: https://news.ycombinator.com/item?id=11373719
Am I just blind or is Lwan missing here: https://www.techempower.com/benchmarks/#section=data-r10&hw=...
The reason struct typedefs are avoided is because I prefer to be explicit (the "Zen of Python" isn't just for Python!). It's also common practice in most of the projects I work on, and it's not much of an issue for me as far as a little bit of typing goes: I'm a fast typist.
The Linux style suggests avoiding it: https://www.kernel.org/doc/html/v4.10/process/coding-style.h...
However, as I said before, this is an open source project; if you have an itch, you can scratch it. PRs are open. :)
Previous discussion:
EDIT: touché! i agree!
A long time ago I benchmarked it, and Lwan came out on top, performance-wise. However, performance isn't the only thing that matters in a piece of software like this.
H2O is a great project; in fact, the authors were tightly involved in the definition of HTTP/2.0, and it is one of the first servers to support this version of the protocol. It is well written, and easy to grok the code. Some of its byproducts include a nice (and reusable) HTTP parser library, and clever tool named qrintf (that pre-parses the format string passed to printf()-family functions and generates optimal code for that).
Also, there's a company behind it -- Lwan is just a toy I work on the weekends when I feel like it.