andrewmusselman opened a new issue, #41:
URL: https://github.com/apache/tooling-gofannon/issues/41
**Optional production-grade pattern**
For squeezing more reliability out of multi-worker uvicorn, the canonical
pattern is gunicorn-as-process-manager with uvicorn workers:
```
CMD ["gunicorn", "main:app", \
"--worker-class", "uvicorn.workers.UvicornWorker", \
"--workers", "8", \
"--bind", "0.0.0.0:8000", \
"--timeout", "0", \
"--keep-alive", "3600", \
"--forwarded-allow-ips=*"]
```
Add gunicorn to requirements.txt. Gunicorn handles worker lifecycle
(graceful restart on memory leaks, signal handling, etc.) better than uvicorn's
built-in process manager. Not required — pure uvicorn --workers works — but
it's what most production FastAPI deployments use.
Skip this if you want to keep changes minimal. The --workers 4 addition is
the actually-load-bearing fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]