What for a medium to large python WSGI application, Apache + mod_wsgi or Nginx + mod_wsgi?

Which combination will require more memory and CPU time?
Which is faster?
Which is renowned for being more stable compared to other?

I'm also thinking to make use of CherryPy's WSGI server however i hear it's not so appropriate for any high-load application, what are you aware relating to this?

Note: I did not use any Python Web Framework, I simply authored the entire factor on your own.
Note': Other suggestions will also be welcome.

For nginx/mod_wsgi, make sure you read:


Due to how nginx is definitely an event driven system underneath, it's behavioral qualities that are harmful to obstructing programs such out of the box the situation with WSGI based programs. Worse situation scenario is the fact that with multiprocess nginx configuration, you can observe user demands be blocked despite the fact that some nginx worker processes might be idle. Apache/mod_wsgi does not have this problem as Apache processes is only going to accept demands if this has got the assets to really handle the request. Apache/mod_wsgi will thus give more foreseeable and reliable behavior.

The writer of nginx mod_wsgi describes some variations to Apache mod_wsgi within this subscriber list message.

The primary difference is the fact that nginx should handle large amounts of connections inside a much more compact storage. This causes it to be very perfect for applications which are doing comet like connections that may have numerous idle open connections. This provides it with a significant more compact memory feet print.

From the raw performance perspective, nginx is faster, but less faster which i would come with that like a identifying factor.

Apache has got the advantage in the region of modules available, and also the fact that's virtually standard. Any hosting company you decide to go with may have it installed, and many technicians will be very acquainted with it.

Also, if you are using mod_wsgi, it's your wsgi server which means you don't even need cherrypy.

Apart from that, the best way forward I'm able to give is try establishing your application under both and perform some benchmarking, since regardless of what anyone informs you, your mileage can vary.

One factor that CherryPy's webserver has going for this is it's a pure python webserver (AFAIK), which might make deployment simpler for you personally. Plus, I saw the advantages of utilizing it if you are simply using a server for WSGI and static content.

(shameless plug warning: I authored the WSGI code that I am going to mention)

Kamaelia may have WSGI support arriving the following release. The awesome factor is the fact that you will probably have the ability to either make use of the pre-made one or construct your own while using existing HTTP and WSGI code.

(finish shameless plug)

With nevertheless, because of the current options, I'd personally most likely opt for CherryPy since it appears to become the easiest to configure and that i can understand python code moreso than I'm able to understand C code.

You might do better to try all of them out and find out exactly what the benefits and drawbacks of every one are for the specific application though.