6

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.

Community
  • 1
  • 1
Tiago
  • 9,457
  • 5
  • 39
  • 35

4 Answers4

3

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.

Andy Hume
  • 40,474
  • 10
  • 47
  • 58
  • 2
    +1. I've seen a few people talk about playing with Spawning, but I've yet to hear of a single serious production website that's using it (not to say there isn't one). AFAICT the momentum is still with Apache/mod_wsgi. – Carl Meyer Feb 01 '09 at 18:59
  • 1
    lighttpd and nginx is more serious – user20955 Feb 02 '09 at 05:59
  • I've asked a question relating to Apache's overhead when using mod_wsgi and I've had a few people vote spawning up... http://stackoverflow.com/questions/488864/django-deployment-cutting-apaches-overhead – Ty. Feb 03 '09 at 18:19
3

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
Pierre-Jean Coudert
  • 9,109
  • 10
  • 50
  • 59
2

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.).

Van Gale
  • 43,536
  • 9
  • 71
  • 81
  • I've read that post, nice resource... I was going to include it in the question, but I forgot. Thanks for your personal opinion! – Tiago Feb 01 '09 at 21:15
  • why not run spawning/django with mod_proxy ? – Black Hand Aug 22 '11 at 19:46
  • mod_proxy should work but I would only use it if there were some *must have* apache mods in the stack (for example, mod_security) otherwise might as well just use nginx as your reverse proxy to Spawning. But in this case gunicorn might be a better option :) – Van Gale Aug 23 '11 at 20:52
0

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.

shamail
  • 99
  • 1
  • 3