[Grok-dev] Re: Apache support for Grok

Philipp von Weitershausen philipp at weitershausen.de
Thu Jan 11 16:55:54 EST 2007


Martijn Faassen wrote:
> Philipp von Weitershausen wrote:
> [mod_zope]
>>> How stable it is? Do you think it could hold up in a production 
>>> environment? I would be willing to take a look at it.
>>
>> It's a prototype, but I don't see why it couldn't be used in a 
>> production environment. The version of wsgiref it uses is probably 
>> outdated. Perhaps there's also a newer mod_python WSGI bridge than the 
>> one I used (wsgi.py).
>>
>> One thing that one needs to be aware of: Apache typically starts a 
>> bunch of Python interpreters (one per Apache process I think). Zope 3 
>> needs to load a lot of bootstrap configuration (ZCML) when it starts 
>> up. It also needs to access the ZODB. 
> 
>> The easiest configuration would therefore be to tell Apache to ever 
>> only start 1 Python interpreter. 
> 
> Can this be done in a shared hosting environment?

No idea.

> Or would you be telling Apache to only start one process? I assume it
> still starts threads, right?

Depending on your MPM, yes or no. The prefork MPM just creates new 
processes, which means a new Python interpreter is loaded up (IIRC) for 
each process. The worker MPM uses a mixture of threads and processes, 
dunno if Python interpreters are shared within threads.

Ideally, it shouldn't make a difference for Zope which Apache MPM is used.

>> An alternative would be to load several and use ZEO (but then you need 
>> a daemon process again).
> 
> Equivalent to the setup where a RDB using application has a daemon 
> process for the RDB. Hosting providers know to deliver, say, MySQL, but 
> there isn't one in the world that delivers ZEO server for us to connect 
> to. :)

Right...

> One way to solve this would be to start working on our RDB-backed 
> version of Zope that can do without the ZODB entirely.
> 
> Any other ideas to make deploying in a shared hosting environment more 
> possible? It would be nice if there were some hack that would make Zope 
> 3 + ZODB work in a fairly standard shared hosting setup.

I agree. When using sqlite in trac, I think it opens a new connection to 
the database on every request. Perhaps we can start out by doing the 
same with the ZODB, and then later optimize by keeping a global 
connection pool around, or something. My lack of knowledge how exactly 
the ZODB works here (I know filestorage uses locks...) and how others 
(trac, svn, etc.) deal with these kinds of things from within Apache 
definitely shows ;).


-- 
http://worldcookery.com -- Professional Zope documentation and training
2nd edition of Web Component Development with Zope 3 is now shipping!



More information about the Grok-dev mailing list