在生产环境中 python web 是否需要使用 nginx 或 apache?

is it neccesary to use nginx or apache for python web in production?

我正在使用 ariadne 和 fastapi 开发 graphql api 并考虑在 hypercorn 服务器上启动它。我不必提供静态文件和图像。因此,在我的情况下,在我进行生产时是否有必要将 nginx 或 apache2 与 hypercorn 一起使用。

注意:- 此服务器上的流量会很大

如果需要使用 apache2/nginx ,如何配置才能与 hypercorn 一起使用?

历史上 apache2/nginx 被推荐在 Python 服务器之前,因为 Python 服务器一次只能处理一个请求,而 apache2/nginx 可以缓冲请求.参见示例 Gunicorn's docs。 Hypercorn(和 Gunicorn 的异步工作者)不是这种情况,因此不需要 apache2/nginx。