Kill $(ps aux | grep uvicorn| grep -v grep| pgrep uvicorn) Uvicorn main:app -reload -host 0.0.0.0 -port Kill $ (ps aux | grep uvicorn| grep -v grep| pgrep uvicorn ) else Uvicorn main:app - reload -host 0.0.0.0 -port } if then Sharing sample snippets of my Monit implementation. I resolved this issue by implementing a shell script and calling it in `monitrc` (Monit’s config file, by default, located at /etc/monit/monitrc with the monit install). To run the application, Monit has to activate the Python virtual environment and move into the respective application folder. One of the reasons being difference in shells between Monit and the terminal program. The FastAPI application’s run command `nohup uvicorn main:app –host hostIP –port portNumber &` could however not be called out as it is in the Monit’s start program command. The web application uses FastAPI as the backend framework which is run using an ASGI server program called Uvicorn. However, I hit a tricky spot while setting up monitoring using Monit. Monitoring and maintaining applications using Monit, is pretty straight-forward for any daemon implementations like nginx. I started off by setting up the Monit daemon, on the respective EC2 instance and enabling Monit’s web interface. Hence, we looked for a monitoring and self-healing solution. The application, silently going down has been troublesome. ![]() In this blog post, I will share my take of solving a specific issue faced while setting up monitoring for a Uvicorn server using Monit.Īt Qxf2, we have a web application built with ReactJS, Neo4j and FastAPI, implemented for an internal use-case.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |