Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Connexion Python框架集多进程_Python_Flask - Fatal编程技术网

Connexion Python框架集多进程

Connexion Python框架集多进程,python,flask,Python,Flask,我尝试配置Connexion,以便在Flask框架中设置尽可能多的进程或线程数。这在烧瓶中是可能的,但似乎Connexion没有将此配置发送到烧瓶。我阅读了Connexion文档,但没有找到任何东西。这可能吗 app = connexion.App(__name__, specification_dir='swagger/', debug=False, processes=4) app.run(port=8080, server='gevent') 我尝试在connexion.App中设置参数

我尝试配置Connexion,以便在Flask框架中设置尽可能多的进程或线程数。这在烧瓶中是可能的,但似乎Connexion没有将此配置发送到烧瓶。我阅读了Connexion文档,但没有找到任何东西。这可能吗

app = connexion.App(__name__, specification_dir='swagger/', debug=False, processes=4)
app.run(port=8080, server='gevent')
我尝试在connexion.App中设置参数,但您无法设置此参数

连接版本:

connexion==1.1.9

我找到了解决办法。使用uWSGI运行应用程序。您可以将Flask WSGI应用程序与任何WSGI容器一起使用

以下是一个例子:

$ sudo pip3 install uwsgi
$ uwsgi --socket 0.0.0.0:8080 --protocol=http --callable app --file app.py --master -p 4  # use 4 worker processes