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

Chris Withers chris at simplistix.co.uk
Mon Nov 26 11:44:32 CET 2007


Hey All,

I hope I have the right list, if not please point me in the right 
direction...

Likewise, if there are good docs that cover all of this, please send me 
their way ;-)

Right, I'm curious as to how wsgi applications end up being 
multi-threaded or multi-process and if they are, how they share 
resources such as databases and configuration.

There's a couple of reasons I'm asking...

The first was something Chris McDonough said about one ofthe issues 
they're having with the repoze project: when using something like 
mod_wsgi, it's the first person to hit each thread that takes the hit of 
loading the configuration and opening up the zodb. Opening the ZODB, in 
particular, can take a lot of time. How should repoze be structured such 
that all the threads load their config and open their databases when 
apache is restarted rather than when each thread is first hit?

The second is a problem I see an app I'm working on heading towards. The 
app has web-alterable configuration, so in a multi-threaded and 
particular multi-process environment, I need some way to get the other 
threads or processes to re-read their configuration when it has changed.

Hope you guys can help!

Chris

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


More information about the Web-SIG mailing list