Apache + mod_wsgi vs nginx + gunicorn Apache + mod_wsgi vs nginx + gunicorn nginx nginx

Apache + mod_wsgi vs nginx + gunicorn


Nginx is a really light and easy to use solution and along with gunicorn it allows us to run any wsgi application and scale it easily.Nginx is better at handling requests since it does not spawn a new process for every request unlike Apache.

I have written an answer on how to deploy django with nginx for a related question:

Deploying Django project with Gunicorn and nginx


Well,the few milliseconds you get with Nginx will not make a hudge difference regarding the time other processes take. Nginx may save RAM but it would only be a great difference on servers with a few RAM. For specific uses on big website there could be some more notable differences but this will become an expert affair then.

The real difference for most is probably the ease of learning. I don't find Apache to be specifically hard to use and the doc is clean. However most of Python tutorials I found are about using Nginx with Gunicorn.

If you already know how to use Apache with Python it would probably be more straight to the point to use it, unless you want to learn Nginx too to improve your CV.

However, if you are a newcomer, there is more documentation about Nginx with Python. It makes it the easier option.


I have good experience with nginx and gunicorn. They keep on working great when I've finally set all the settings right and got it running.

For nginx and gunicorn they are:

* nginx configuration files (/etc/nginx/sites-enabled/ and /etc/nginx/nginx.conf)* gunicorn configuration files (/etc/init/gunicorn.conf and /etc/gunicorn.d/) 

I've seen a tutorial for apache + mod_wsgi and it seems so much simpler to set up.