views:

45

answers:

1

When you use Django with mod_wsgi, what exactly happens when a user makes a request to the server from a browser? Does apache load up your Django app when it starts and have it running in a separate process? Does it create a new Python process for every HTTP request?

+1  A: 

In embedded mode, the Django app is part of the httpd worker. In daemon mode, the Django app is a separate process and the httpd worker communicates with it over a socket. In either case, the WSGI interface is the same.

Ignacio Vazquez-Abrams
Is there a performance difference between daemon mode and embedded mode?
Barakat
The simple answer is "yes". The full answer depends on a number of factors, such as number of workers, size of the app, and more.
Ignacio Vazquez-Abrams
Hmmm, this doesn't actually answer the whole question, it is a bit more complicated than that. :-)
Graham Dumpleton