-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
So i have a project that was made back in the days using Flask, and I wanted to test it with FastAPI.
I made the changes, and it worked normally, the problem occured when I made a swarm test using Locust.
With Flask, I got 0 failures in 10.000 requests, with 1.000 users at the same time.
With FastAPI, I got 387 failures in 10.000 requests, with 1.000 users at the same time.
The error is:
ConnectionError(ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')),)
I started my app with the following command:
gunicorn -w 3 -k uvicorn.workers.UvicornH11Worker -b 0.0.0.0:5005 main:app --timeout 200
Anyone knows why I got this connection error with FastAPI and not with Flask?
This is my main.py FastAPI file:

This is the service that was tested:


