Could anyone please explain pros/cons when using WSGI VS uWSGI with Nginx.
Currently i am building up a production server for the Django website which i have prepared but unable to decide whether should i go with WSGI or uWSGI. Could you please explain in detail what differentiates each configuration? Which configuration should scale the best?
Thanks in advance
I believe this right here http://flask.pocoo.org/docs/deploying/uwsgi/ is a good answer to clear up the confusion. The question isnt silly, happens to anyone who sees the two terms and has no prior info on how things work outside of mod_PHP world (for e.g. nothing against php or folks)
The site does well to explain in practical terms what is needed and what is the difference as well as a good deployment example for nginx.
This blog post is a very detailed comparison of alot of Python WSGI servers, with a summary and some recommendations at the end.
It is generally best to run Python in a separate process from your main web server. That way, the web server can have lots of tiny threads that serve static content really fast, while your separate Python processes will be big and heavyweight and each be running their own Python interpreter. So plain
WSGI
is bad, because it bloats every single one of your nginx threads with a big Python interpreter. Usingflup
orgunicorn
oruWSGI
behindnginx
is much better, because that frees up nginx to simply serve content, and lets you choose how many tiny light nginx threads to run, independently of your choice of how many heavyweight Python threads you bring up to serve dynamic content. People seem very happy withgunicorn
at the moment, but any of those three options should work fine.Going forward, it also frees you up to move the Python to another server when load starts to get serious.
Ok, guys this confusion is because of lack of detail from several sources, and the naming of these protocols, and what WSGI actually is.
Summary: