I'm running multiple Django sites on the same Apache instance under mod_wsgi. Currently my apache.conf files contain the following directives (no WSGIApplicationGroup
specified):
WSGIDaemonProcess mysite \
display-name=mysite \
threads=50 \
maximum-requests=10000 \
umask=0002 \
home=/srv/www/mysite \
python-path=/srv/www:/srv/src:/srv/venv/prod/lib/python2.7/site-packages \
python-eggs=/srv/.python-eggs
WSGIProcessGroup mysite
WSGIScriptAlias / /srv/www/mysite/wsgi.py
I touch /srv/www/mysite/wsgi.py
whenever I need to reload the site, and it causes a noticeable freeze in all clients.
After reading https://groups.google.com/forum/#!topic/modwsgi/QJkt5UWYpss it sounds like I can get rid of the "reload pause", by specifying process/application groups in the WSGIScriptAlias
directive:
WSGIDaemonProcess mysite \
display-name=mysite \
threads=50 \
maximum-requests=10000 \
umask=0002 \
home=/srv/www/mysite \
python-path=/srv/www:/srv/src:/srv/venv/prod/lib/python2.7/site-packages \
python-eggs=/srv/.python-eggs
WSGIScriptAlias / /srv/www/mysite/wsgi.py \
process-group=mysite \
application-group=mysite
IIUC, I need to provide both process-group=
and application-group=
for the preloading to happen.
All the docs I've found so far uses application-group=%{GLOBAL}
, but that seems wrong for my use case, where each virtual host should run code based on the individual site's settings.py
file (correct?).
Should I use the predefined %{RESOURCE}
variable instead of mysite
.
Can I share the same application-group between the http and https versions of the same site? (I know I can't do that with the process group).