bjoern: Fast And Ultra-Lightweight Asynchronous WSGI Server
Why it is Cool
bjoern is the fastest, smallest and most lightweight WSGI server out
- < 1000 lines of code
- Memory footprint ~ 600KB
- Single-threaded and does not use coroutines or other crap.
- 100% WSGI compliance (except for the write callback design mistake)
What's not Cool
- Not HTTP/1.1 capable (yet).
pacman -S libev
sudo aptitude install libev-dev
Mac OS X (using homebrew):
brew install libev
Other platforms may require installing libev from source.
Make sure all the dependencies mentioned in the previous section are installed before issuing the following command:
pip install bjoern
bjoern is easy. You can run a WSGI application directly using
bjoern.run(wsgi_application, host, port)
Alternatively, you can run the main event loop separately:
bjoern.listen(wsgi_application, host, port) bjoern.run()
Compared with other WSGI servers
There are existing servers that attempt to deal with WSGI but perform poorly for the reasons highlighted in this comparison table: