-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📝 Update Gunicorn guide to use uvicorn-worker library #11855
📝 Update Gunicorn guide to use uvicorn-worker library #11855
Conversation
📝 Docs preview for commit 98c1c8d at: https://af3405bf.fastapitiangolo.pages.dev |
98c1c8d
to
5b057ce
Compare
📝 Docs preview for commit 5b057ce at: https://9afd07f2.fastapitiangolo.pages.dev |
Ready to merge 🟢 |
My recommendation is to remove Gunicorn from the documentation. |
I've had some not-so-great experiences running native Uvicorn workers on production instances due to: 1-potential memory leaks on long running instances, 2-slightly lower performance, 3-and higher tendency to timeout (502) under load compared to Gunicorn-Uvicorn workers. I think keeping it as an option is still a good thing to have, especially for long running production instances. |
I can proof it with measurements: |
When did you do that? Also... There's no need to prove anything here. |
5b057ce
to
8aa7fcc
Compare
📝 Docs preview for commit 8aa7fcc at: https://843d246e.fastapitiangolo.pages.dev Modified Pages |
Hi @siavashyj Thanks for your time and for helping us handle this topic. 🙇 We have planned to change these docs soon and we'll be reviewing it! 🤓 |
📝 Docs preview for commit 431679a at: https://f8afe6c3.fastapitiangolo.pages.dev Modified Pages |
Thanks for the interest @siavashyj! I prefer to recommend the new Uvicorn with I updated the docs here: #12069, that should cover this. I'll now close this one, but thanks for the effort! ☕ |
Update FastAPI Server Workers Documentation
Description
This PR updates the FastAPI Server Workers documentation to reflect the changes in Uvicorn worker implementation. The
uvicorn.workers.UvicornWorker
has been deprecated as of Uvicorn version 0.30.0, and we're now recommending the use of theuvicorn-worker
package.Changes
uvicorn-worker
packageuvicorn.workers.UvicornWorker
touvicorn_worker.UvicornWorker
--worker-class
option to reflect the new importRationale
These changes are necessary to keep our documentation up-to-date with the latest best practices for deploying FastAPI applications with Gunicorn and Uvicorn workers.
Testing
Additional Notes
Users upgrading from an older version may need to update their deployment scripts to use the new
uvicorn_worker.UvicornWorker
class. We may want to consider adding a migration guide or note in the documentation to help with this transition.