python - Python Flask 可以使用 Gunicorn 处理多少个并行请求?
问题描述
你能检查一下我是否遗漏了配置中的任何内容吗?
我正在使用 Gunicorn 运行一个 python 烧瓶应用程序。
我们目前的事件流程是:
- Jmeter 将并行触发 8-10 个作业并将它们发送到 AWS 负载均衡器
- 然后一个请求通过 Nginix 代理并转发到在 EC2 实例上运行的 Gunicorn/Flask 应用程序。
我正在使用以下配置在 Gunicorn/Flask 上启用多处理,但这些命令没有任何效果,因为我看到作业是串行执行的,而不是并行执行的。请帮助我了解我需要更改哪些内容才能让所有这些作业并行执行。这是我尝试过但没有任何效果的命令列表:
这些命令是我尝试过的同步命令:
gunicorn app1:application -b localhost:8000 --timeout 90000 -w 17
gunicorn app1:application -b localhost:8000 --timeout 90000 -w 17 --threads 2
gunicorn app1:application -b localhost:8000 --timeout 90000 -w 17 --threads 2 max_requests_jitter 4
gunicorn app1:application -b localhost:8000 --timeout 90000 -w 17 --max-requests 4
这些命令是我尝试过的异步命令:
gunicorn app1:application -b localhost:8000 --timeout 90000 -w 17 --worker-class tornado
gunicorn app1:application -b localhost:8000 --timeout 90000 -w 17 --worker-class gevent
gunicorn app1:application -b localhost:8000 --timeout 90000 -w 17 --worker-class gthread
gunicorn app1:application -b localhost:8000 --timeout 90000 -w 17 --worker-class eventlet
解决方案
推荐阅读
- javascript - 空元素和 getElementsByClassName
- gradle - 如何使用 c 插件在 gradle 中构建 emcc
- wordpress - 由于 .htaccess 文件中的代码,Wordpress 站点搜索功能无法正常工作
- php - cookie设置但不显示在另一个页面php
- python - 如何使用 django 基于类的通用视图添加最喜欢的文章标记系统?
- python-3.x - 在 tkinter 库中看不到 GUI
- jquery-isotope - 如何使用同位素过滤器和自举手风琴?
- emulation - 拥有多个调色板的 GameBoy 有什么意义?
- tensorflow - 张量流中张量的 _keras_shape 和 _shape 有什么区别?
- java - 如何在对话框中知道另一个对话框在android中的java类中使用这个对话框关闭了?