nginx - 使用uwsgi协议(protocol)将uWSGI连接到NGinx有什么好处?

标签 nginx wsgi uwsgi

我有一个 uWSGI service运行 Python Flask framework在 EC2 上获取一些内部 API。 uWSGI 监听一个内部端口,该端口与外界隔绝。

服务器运行 NGinx 在端口 80/443 上为来自外部的请求提供服务,并使用普通的 http 代理将这些请求代理到 uWSGI 到内部端口。

NGinx can also connect to uWSGI使用 uwsgi protocol .

enter image description here

与普通的 http 代理相比,使用此协议(protocol)有什么优势?

最佳答案

根据the research从 PageFair 开始,您将通过 tcp+http 使用 unix_socket+uwsgi 提高吞吐量。它不是x2,但仍然。

他们提供的数字表明tcp_socket+http每秒获得 1247 次查询,而 unix_socket+uwsgi得到 1495 q/s。

关于nginx - 使用uwsgi协议(protocol)将uWSGI连接到NGinx有什么好处?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36475380/

相关文章:

docker - 将 SSL 证书添加到 NGINX docker 容器

css - Nginx 不会在树莓派的 Asp.net 核心上加载 css

bash 脚本语法错误 : word unexpected (expecting "do")

nginx: [emerg] "location"指令在/etc/nginx/nginx.conf:16 中是不允许的

python - 使用要在模板中使用的中间件在 Flask 请求中设置变量

python - 哪些 Web 框架支持 Python3(PEP3333 - WSGI 1.0.1 合规性)

python - nginx下运行python

python - 单个 Flask 进程接收多少并发请求?

django - uwsgi不创建套接字文件

python - PasteDeploy 与 uwsgi 一起使用时抛出 TypeError