Wednesday, July 30, 2014

Re: Flup vs Guicorn vs uWsgi on Nginx

> Hi Folks,
> We are in our initial deployment stage, and have decided to deploy
> django(1.6.X) on Nginx, and trying to decide which WSGI server to use.
> I am positive all have something to offer and may not be fair just to
> throw out "which one to use", but I was hoping to get some guidance on the
> following items

Unfortunately no-one can give you a satisfing answer, because lot of
things come into play. I will focus on uWSGI and gunicorn as flup is
basically a dead project (afaik)

>
> 0. Handle high concurrent requests

both uWSGI and gunicorn support multiprocessing. As you are using django i
will not suggest you using async approaches (like gevent) even if both
support them.

uWSGI has strong multithreading support too, and gunicorn is working on it
(probably should be ready in the next release). If you are app is not
cpu-bound, multiple threads are a good solution in python (i bet you will
find tons of posts regarding the infamous GIL, but you can ignore them, as
the GIL is released during I/O operations)

In both threads and multiprocessing, do not choose their number using
silly math (like cpu * 2). Start with a low-number (like 4) and constantly
monitor your app to see if you need to raise or decrease them. New-relic
could be a great toy for it.

> 1. Performance / less transnational overhead,

this is nothing related to WSGI servers, your app will be the bottleneck.
Always.

> 2. Compatible with django/Nginx, in a sense easy configuration

both have now pretty decent documentation for newbies, but gunicorn is way
simpler from an architectural point of view, so probably you will find
easier to start with it.
On the other side uWSGI is more sysadmin-oriented so it has dozens of
features for app monitoring and to manage and detect critical conditions.

> 3. Large number of users

with mod_wsgi they are the three most used servers, so i would not waste
time on this point. There is a lot of documentation about all of them. And
remember you can proxy an apache+mod_wsgi in embedded mode behind nginx
too. Lot of users prefer this approach.

Apache can be a good application server.

(disclaimer: i am the uWSGI lead developer)

--
Roberto De Ioris
http://unbit.it

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/eef4aa58de830c3e68a4a0eeaf7bc66f.squirrel%40manage.unbit.it.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment