NXWEB - ultra-fast web server based on libev

Yaroslav yarosla at gmail.com
Fri Dec 2 00:55:27 CET 2011


I'd like to thank the authors of libev for very good product. Based on it I
have developed NXWEB web server, which I'd like to present to community.
Here are the highlights:

What NXWEB offers:

   - good performance; see benchmarks at project page
   - can serve thousands concurrent requests
   - small memory footprint
   - multi-threaded model designed to scale
   - exceptionally light code base
   - simple API
   - decent HTTP protocol handling
   - keep-alive connections
   - non-blocking sendfile support
   - modular design for developers
   - can be run as daemon; relaunches itself on error
   - open source


   - no SSL support (yet)
   - only tested on Linux


Main thread binds TCP port, accepts connections and distributes them among
network threads.

*Network threads* work in non-blocking fashion (using libev) handling HTTP
protocol exchange. There should be no need in using more network threads
than the number of CPU cores you have, as every thread is very efficient
and can easily handle thousands of concurrent connections.

After receiving complete HTTP request network thread finds and invokes
application's *URI handler*. The invocation could happen within network
thread (should only be used for quick non-blocking handlers) or within
worker thread (should be used for slower or blocking handlers).

*Worker threads* are organized in pool. Each thread takes new job from
queue, invokes URI handler, signals network thread after handler completes
the job. If your handler is slow, you need to configure more worker threads.

Numbers of network and worker threads are configured via #define directives.


NXWEB project page: https://bitbucket.org/yarosla/nxweb/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20111202/6f982560/attachment.html>

More information about the libev mailing list