This project is a proof of concept which aims at making an efficient multi-core Python HTTP server. LWAN, written in C, is running under the hood. Cython is used to wrap it into a Python module.
A blog post explains the process in more details.
LWAN must be installed on your machine as a library. To do so, you can either follow the instructions from the LWAN repository or run install_lwan.sh
if you are feeling lazy. In any case, make sure to have the required dependencies installed before.
Then, install Cython using pip:
pip3 install cython
A simple Makefile automates the building and running part:
make
make run
Your server should be listening on 0.0.0.0:8080
.
A Go HTTP server is also provided for comparison. It uses two different implementations:
Implementation | How to run it |
---|---|
net/http |
go run golang/server.go -fast=0 |
fasthttp |
go run golang/server.go -fast=1 |