skip to Main Content

I have a fastapi service deployed on AWS, the API sends request to OpenAI API to generate text.

This API had been running fine for 2-3 days but now it keeps restarting on it’s own after every 10 minutes. There are no errors or any helpful information in the AWS logs.

I also set request_timeout to 30 seconds in case this was happening because OpenAI API took too long to respond.

Any info about this is appreciated.

edit:
start.sh file contains this line: python3 main.py

and main.py is as follows:

import uvicorn

if __name__ ="__main__":
   uvicorn.run("app.main:app, host="0.0.0.0", port=9026, reload=True)

2

Answers


  1. you need to try uvicorn app.main:app --reload --host 0.0.0.0 --port 9026
    in bash script to run, It is just another way to run.

    Login or Signup to reply.
  2. Please check health check in Task Definition

    Its mentioned here:
    uvicorn shutting down after 1-2 minutes on AWS Fargate

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search