I'm currently running 125 Django sites on a single dedicated box at GoDaddy. The sites are relativelly low traffic and I'm wondering what i can do to optimize the memory usage in my apache config. Before I tuned the prefork directives to a lower MaxServer and MaxrequestsPerChild, the box would hang after about 5 hours of being live.
I've been scowering google for answers, but I can't come up with anything definite for the following:
- Are there any arguments for mod_python vs mod_wsgi in multi site django installs
- Is there a way to optimize static file serving to conserve memory in apache virtual hosts? (/site_media/ vs media.domain.com)
- What is the argument for prefork vs worker and memory usage in a multi VirtualNameHost environment?
Current config file included below:
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /var/www/projectroot/django/chat/static
ServerName domain.com
ServerAlias www.domain.com
Alias /media /usr/lib/python2.5/site-packages/django/contrib/admin/media
ErrorLog logs/www.domain.com-error_log
CustomLog logs/www.domain.com-access_log common
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/var/www/domain/django'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE chat.settings_domain1 #chat is the name of the project all the sites reside in
PythonDebug Off
</Location>
<Location "/media">
SetHandler None
</Location>
<Location "/site_media">
SetHandler None
</Location>
</VirtualHost>
Thanks! -Tom