WebFrameworks for testing:
Here 3 identical web applications with the same components and routes are described:
Components:
Routes:
GET /pingGET /db/onePOST /db/insertGET /cache/getPOST /cache/setGET /mix
docker compose up --build -dexport $APP_HOST=127.0.0.1 # or your real IPwrk -t8 -c512 -d2m http://$APP_HOST:8001/ping # aiohttp
wrk -t8 -c512 -d2m http://$APP_HOST:8002/ping # litestar
wrk -t8 -c512 -d2m http://$APP_HOST:8003/ping # fastapiwrk -t8 -c512 -d2m --latency -s ./wrk_scripts/db_one.lua http://$APP_HOST:8001
wrk -t8 -c512 -d2m --latency -s ./wrk_scripts/db_one.lua http://$APP_HOST:8002
wrk -t8 -c512 -d2m --latency -s ./wrk_scripts/db_one.lua http://$APP_HOST:8003wrk -t8 -c512 -d2m --latency -s ./wrk_scripts/mix.lua http://$APP_HOST:8001
wrk -t8 -c512 -d2m --latency -s ./wrk_scripts/mix.lua http://$APP_HOST:8002
wrk -t8 -c512 -d2m --latency -s ./wrk_scripts/mix.lua http://$APP_HOST:8003You can try granian for litestar and fastapi servers:
granian performance.server_litestar:app --host 0.0.0.0 --port 8000 --workers 4 --workers-max-rss 1024 --workers-lifetime 6h --interface asginl --loop uvloop --backlog 4096 --backpressure 1024 --no-access-log --log-level infogranian performance.server_litestar:app --interface asginl --workers 4 --workers-lifetime 6h --workers-max-rss 1024 --loop uvloop --backlog 4096 --backpressure 1024 --no-access-log --log-level info