Assuming you are using mod_wsgi, you can segment your WSGI application through several process groups of the mod_wsgi daemon with specific URLs that you want to limit to delegated by your own mod_wsgi daemon process group, with fewer processes / threads.
WSGIDaemonProcess myapp processes=2 threads=10 WSGIDaemonProcess myapp-restricted threads=2 WSGIScriptAlias / /some/path/app.wsgi WSGIProcessGroup myapp <Location /some/specific/url> WSGIProcessGroup myapp-restricted </Location>
Note that requests queued to access these two threads in a restricted process will still consume the workflow in the main child processes of the Apache server. So you want you to use working MPM (so not mod_php) and configure MPM with enough spare threads to handle these backup requests, as well as normal traffic.
source share