This project hosts the same application implemented in CherryPy, FastAPI and Flask. Then, we load test each one of then using autocannon and present the results.
The application contains two endpoints:
GET /
: receives no input data and returns{"Hello": "World"}
POST /users
: receives{"name":str, "age":integer, "location":str}
and returns the input content concatenated 1024 times
To run each app we use the application server recommended on the framework docs.
On each run.sh
file I also added a commented line with the command to run the app with Gunicorn (production WSGI server) with 4 sync workers for CherryPy and Flask and 4 UvicornWorker's for FastAPI.
- Clone the repository
- Run
docker compose up
on the root directory
The applications will be listening on the ports:
Application | Port |
---|---|
flask | 5000 |
fastapi | 8000 |
cherrypy | 8080 |
- Install autocannon
- Run
./test.sh --post
or./test.sh --get
depending on which endpoint you wants to load test The tests runs for 10 seconds with 30 simultaneous connections for each app.
Linux Mint 20 on Ryzen 5 5400G, 32GB of RAM