8 months ago
Hello,
I wanted input on our 502 errors that happen 15ms after request to our Fast API instance. I don't see any suspects when searching "Error:" in our logs. I think 15ms is too soon to be a timeout at the App layer or a worker timeout. I think it is possible that this happens before it gets to the app layer.
I'd estimate 1 in 100 or 1 in 200 has this issue where it 502s in under 30ms.
Here's an overview of our infrastructure.
We're serving a Fast API via Gunicorn with the start script below.
```
gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000 --timeout 120 --log-level debug --access-logfile -
```
Our metrics look healthy and we're way over provisioned. We have 15 vCPU on this instance and have never seen over 1 vCPU in use. We have 15 Max 15 GB and never seed over 1.2 GB in use.
Can you provide input and let us know how to avoid these 502s?
Thanks!
1 Replies
8 months ago
502 indicates it's very unlikely to be infra issue unless there's an outage (not the case atm).
Would recommend reviewing application level code here -- we don't have observability into what might be going on.
Sorry can't be more helpful
Status changed to Awaiting User Response Railway • 8 months ago