简体   繁体   中英

Connexion Python framework set multiprocesses

I try to configure Connexion to set the number of processes or threads as is possible in Flask framework. This is possible in Flask but it seems that Connexion is not sending this configuration to Flask. I read the Connexion documentation but I didn't find anything. Is this possible?

app = connexion.App(__name__, specification_dir='swagger/', debug=False, processes=4)
app.run(port=8080, server='gevent')

I try to set the parameters in connexion.App but you can't set this kargs.

Connexion version:

connexion==1.1.9

I found a workaround for this. To run the application with uWSGI. You can use the Flask WSGI app with any WSGI container. Using Flask with uWSGI

Here is an example:

$ 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM