The following question is aimed for two use cases.
- Use case 1: Deploying a single WSGI app on a single server.
- Use case 2: Deploying one or more WSGI apps on the same server.
My question:
I am wondering about WSGI applications (based on frameworks) such as Flask, CherryPy, Pyramid etc.
And WSGI servers such as Gunicorn, Waitress etc.
Thank you.
Just go for virtualenv -- different apps with different libs can coexist peacefully; and if it's a single app only, it's still no harder to set up, but leaves you flexibility for the future.
Same applies to native WSGI servers, just install them into virtualenv, it won't hurt the performance.
What WILL hurt it is Python's multithreading because of GIL, so stay away from native threaded servers like Waitress. Use multiprocess servers (or asynchronous, where it makes sense), which, I believe, Gunicorn is. Consider using uWSGI -- it is very powerful, although not native.
Flask, etc are not applications, they are frameworks that let you develop your applications easier by relieving you from a burden of processing basic things like parsing paths, sending appropriate headers, etc. You just need to choose the one that suits your needs better.