Partition Django site across multiple processes?

Skip to first unread message


Nov 26, 2021, 4:08:03 PM11/26/21
to modwsgi
Is it possible to partition traffic for a single Django site across multiple processes i.e. use WSGIScriptAlias to point to the same WSGI script but configure a subset of URLs to route to different processes? 

Apache virtual host configuration excerpt:

WSGIApplicationGroup api
WSGIDaemonProcess api processes=2 display-name='%{GROUP}' lang='en_US.UTF-8' locale='en_US.UTF-8'
WSGIScriptAlias /api <path>/ process-group=api application-group=api

WSGIApplicationGroup web
WSGIDaemonProcess web processes=5 display-name='%{GROUP}' lang='en_US.UTF-8' locale='en_US.UTF-8'
WSGIScriptAlias / <path>/ process-group=web application-group=web

When configured like this /api traffic does appear to be picked up by the correct process but fails Django URL resolution (and raises a 404).

Quite possible that this is purely a Django issue, but just want to check if this approach is feasible / advisable.


Graham Dumpleton

Nov 26, 2021, 4:11:10 PM11/26/21
See explanation in this blog post.

You only want one WSGIScriptAlias mount directive and use Location to apply conditions on where traffic is directed.

Also recommended to force use of main interpreter context in each daemon process group by setting WSGIApplicationGroup to %{GLOBAL}. This avoids issues with some Python packages that will not work in sub interpreters.


You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit


Nov 29, 2021, 5:34:05 AM11/29/21
to modwsgi
Thanks - much appreciated.
Reply all
Reply to author
0 new messages