Question

There's no much documentation on how to deploy a Django project with Spawning and yet people are recommending it over apache/mod_wsgi.

In another similar question, other SO user suggested me to open a new question specific to Spawning, so hopefully others can share their experiences too.

Was it helpful?

Solution

I'd be interested in seeing whose seriously recommending Spawning over Apache and mod_python or mod_wsgi.

Judging by the fact that this question is now the #4 result in Google for 'django spawning' I'd say it's very much early days. :) If you're putting anything serious into production stick to Apache/mod_wsgi for now.

OTHER TIPS

cd to your django's settings.py directory.

Here is the command line to serve your django application

spawn --factory=spawning.django_factory.config_factory settings --port 80

Eric Florenzo did some basic testing of spawning. Make sure and read all the comments as well as the main post.

Personally I always like investigating these kinds of solutions, but in this case I just can't even get to a benchmarking stage. There are too many important features I need in Apache (ssl client certs, run mongrel servers under fastcgi, django under wsgi, php gasp, static files served directly, ssl for each ip address, dozens of virtual hosts on multiple ip addresses, etc.).

Yes, I could recommend you to use spawning over apache/wsgi setup.

Two reasons basically: 1) Memory usage (you'll save some MBs on spawning) 2) Dynamic code reloading (at no point of time, your user's will see a 404 or 500 page)

This comes from experience, I am running http://tunesdiary.com on spawning+nginx in this setup:

nginx handles all the incoming load which further proxy connection to spawning which is listening on a unprivileged port (means spawning is running as a different user than the web-server) Spawning spawns 4 processes with 2 threads per process. (works for the current load).

As I push any code to the server, the previous requests are handled, and then the new code starts serving the new requests.

This has been working very good till now (I am running this from about 6 months)

What I've observed, django with mod wsgi + apache (which I used for some days earlier) was taking about 70MB of RAM after getting started (single process), and this setup uses 45MB per process or so. Also, I've also had this with lighttpd + modfcgi which also consumes almost same amount of memory than spwaning.

(I might have miscalculated because in apache, the webserver's memory usage is also included)

You can rely on spawning, as far as I can say, but if if you don't really push often, it won't be of much use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top