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
2010-05-18 10:45:09
Is there a performance difference between daemon mode and embedded mode?
Barakat
2010-05-18 10:50:03
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
2010-05-18 11:01:23
Hmmm, this doesn't actually answer the whole question, it is a bit more complicated than that. :-)
Graham Dumpleton
2010-05-18 22:52:56