On Jul 19, 11:41 pm, Tereno <ter...@gmail.com> wrote: > Hi there, > > I have a few questions about Django deployment on production so > hopefully you can help me sort it out. > > Firstly, what's the minimum memory requirements for a Django + Apache > + mod_wsgi setup? It seems like my server ran out of memory when I > tried it and I think I may only have 256MB RAM. If Apache's the cause, > would it help if I switched to use other webservers or would it be > better for me to increase my RAM?
You are likely using mod_wsgi embedded mode and possibly even with prefork MPM. This is a very bad combination, see: http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html > Secondly, if I have multiple sites, let's say 2 static html sites and > 2 Django-powered sites, should I use separate Django instances for > each of the Django-powered sites? That is preferred and the model that supports this is much more kind to memory constrained systems anyway as it gives you better control of memory usage. So, see daemon mode in mod_wsgi and delegate each Django instance to a separate daemon process group. See: http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide > I don't want to have to bring both > sites down when I restart Django for making a configuration change to > one of the sites. I guess I'm not too sure how mod_wsgi works. Will > each site be treated as a separate process or will they be one wsgi > process? Use daemon mode and they are separate and there are ways of controlling restart of them individually separate from restarting whole of Apache. See: http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide > I find that all this configuration and memory monitoring for Django is > abit tiring and I am no expert Sorry, this isn't PHP and Python requires you to be a bit more mindful of these things. If you aren't you can quite easily hit problems. Graham -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.