A screamingly fast Python WSGI server written in C.
C Python
Switch branches/tags
Nothing to show
Pull request Compare This branch is 15 commits ahead, 154 commits behind jonashaag:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bjoern
http-parser @ 03970a5
tests
.gitignore
.gitmodules
AUTHORS
KNOWN_ISSUES
LICENSE
MANIFEST.in
Makefile
README
README.rst
TODO
setup.py

README.rst

bjoern: Fast And Ultra-Lightweight Asynchronous WSGI Server

A screamingly fast, ultra-lightweight asynchronous WSGI server for CPython, written in C using Marc Lehmann's high performance libev event loop and Ryan Dahl's http_parser.

Why it is Cool

bjoern is the fastest, smallest and most lightweight WSGI server out there featuring:

  • < 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).

Installing Dependencies

Arch Linux:

pacman -S libev

Ubuntu Linux:

sudo aptitude install libev-dev

Mac OS X (using homebrew):

brew install libev

Other platforms may require installing libev from source.

Installation

Make sure all the dependencies mentioned in the previous section are installed before issuing the following command:

pip install bjoern

Usage

Using bjoern is easy. You can run a WSGI application directly using the bjoern.run function:

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:

Name Bloated Slower Messy Code
Fapws3     Yes
gunicorn Yes Yes  
uWSGI Yes    
meinheld Yes    
$SERVER Yes Yes Yes