Answer the question
In order to leave comments, you need to log in
How can I run a Flask application with a gevent WSGI server and still use all the CPU cores?
How can I run a Flask application with a gevent WSGI server and still use all the CPU cores? There is such an option: run several copies of the application, in which a separate port in a certain range is listening. For example, for 4 cores, we launch 4 processes and listen to ports in the range 5000..5003. We put nginx in front as a load balancer. But I'm not sure if this is the best option and maybe there are better ones?
Also, in your experience, what other WSGI servers would you recommend for a Flask deployment? gevent was chosen because it uses lightweight streams and the event loop is implemented with libev, so you can process client requests efficiently and quickly.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question