Larus: A WSGI HTTP Server [WIP]
Larus is a simplified Gunicorn clone
$ pip install larus
$ python setup.py install
Usage: larus [OPTIONS] MODULE_APP Options: -w, --workers INTEGER number of workers, default: 1 -b, --bind TEXT address to bind: host:port, default: 127.0.0.1:8000 -c, --chdir TEXT change the working director --help Show this message and exit.
For example, if
myapp.py contains the wsgi app
app, we can serve it with larus with:
4 workers and bind to
larus -w 4 -b 0.0.0.0:5000 myapp:app
You can use signals to dynamically increment or decrement the number of workers while serving:
TTIN: Increment the number of workers by one
TTOU: Decrement the number of workers by one
In my simple benchmark using
ab, Larus performs better than Gunicorn both running 4 sync workers.
Perhaps benefits from the C http parser Larus using.
TODO: add detailed comparison.
- Add more worker types