Lwan is a high-performance & scalable web server.
Requests per second vs. number of concurrent connections?
Hello, World! (C) | 100B file | ||
Hello, World! (LuaJIT) | 32KiB file |
Lwan was until recently just a personal research effort that focused mostly on building a solid infrastructure for a lightweight and speedy web server.
With its low disk and memory footprints, it's suitable to be used from embedded devices to robust servers. Both static and dynamic content can be served, as it can also be used as a library. Dynamic content can be generated by code written in either C or Lua.
Its simple architecture and tiny source code guarantees the entire code base can be easily grokked.
Connections are handled individually by coroutines, which are transparently and efficiently juggled by a per-CPU cooperative scheduler, giving the illusion of blocking I/O to handlers.
Resource management is also greatly simplified with coroutines: whenever a client connection is closed, memory is automatically reclaimed, files are automatically closed, references are automatically decremented. This provides more predictability than most garbage collectors, helping keep latencies low while being almost as easy to use.
0