[Web-SIG] multi-threaded or multi-process wsgi apps

Chris Withers chris at simplistix.co.uk
Fri Nov 30 00:23:20 CET 2007


Graham Dumpleton wrote:
> For daemon mode, in mod_wsgi 2.0 there is also 'Process' reload
> mechanism as an option. Just touching the main WSGI script file entry
> point will cause just the processes for that daemon process group to
> be restarted on next request, thereby avoiding a restart of the whole
> Apache web server and any other hosted applications.

Cool, when's 2.0 out?

> Thus, change your config file, whether it be actual Python code or an
> ini file and touch the main WSGI script file for that application.
> Upon the next request against that application it will detect WSGI
> script file has changed and will do the restart.

Will that restart all processes/sub processes/threads?

> For other options on how to trigger automatic reloading of application
> process in mod_wsgi when code and/or config changes see:
> 
>   http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

Not sure I followed it all, but certainly looks useful :-)

> Latter example in this based on similar stuff that Ian has done, just
> customised to the setting of mod_wsgi and that one can rely on
> mod_wsgi to automatically restart a daemon process when killed off.
> Thus bit different to where this sort of idea is used elsewhere to
> trigger in process reload of modules on top of existing modules, which
> will not always work because of dependencies between modules.

Yes, Zope learnt this the hard way :-(
The was a "Refresh" add-on for a long time which 70% worked and so 
caused a lot of trouble...

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Web-SIG mailing list