best way to serve wsgi with multiple processes
Robin Becker
robin at reportlab.com
Thu Feb 12 05:08:11 EST 2009
Graham Dumpleton wrote:
.........
> requests.
>
> If the work is indeed long running, the backend process would normally
> just acknowledge the request and not wait. The web page would return
> and it would be up to user to then somehow occassionally poll web
> server, manually or by AJAX, to see how progres is going. That is,
> further XML-RPC requests from main server to backend daemon process
> asking about progress.
.......
this is exactly what we do with the long runners. The wsgi (django in our case)
process can work out how long the process is likely to take and either responds
directly or offloads the job to an xmrpc server and responds with a page
containing a token allowing access to the queue server which refreshes
periodically to determine job status etc etc. When the job finishes the refresh
request returns the job result and finishes looping. In our case we don't need
to worry about people abandoning the job since the results are cached and may be
of use to others (typical case produce brochure containing details of all
resources in a country or large city). To avoid overload the xmlrpc server is
only allowed to run 3 active threads from its queue.
--
Robin Becker
More information about the Python-list
mailing list