[lxml-dev] About lxml status

Hans-Jürgen Hay hjh at alterras.de
Thu Dec 14 17:31:48 CET 2006


Greethings,

I found out very late and this gave me serious headaches. pickle does
not work with XSLT objects. eaven if it did it would propably perform
much worse than building from source. But thanx for the tip, maybe the
developers can help out a little with coarse graind locking at a later
stage. Using lxml with mod_python should be an interesting use case. 

Regards
Hans  

Am Donnerstag, den 14.12.2006, 10:46 -0500 schrieb Lee Brown:
> Greetings!
> 
> Thanks for the warning, but I've already run headfirst into that problem.  My
> apache server is running the Win32MPM, where every request is a new thread, so
> there aren't any tricks I can play with the PythonInterpreter directive.  (None
> that help, anyway.)
> 
> However, I did some benchmark tests and found that I can serve about 32 requests
> per second even with the overhead of recompiling the XSLT template new for each
> request.  This is adequate for my needs, though a very busy website might have
> trouble.
> 
> One thing I haven't tried is to pre-compile my XSLT templates and cPickle them
> to disk files and then unpickle a copy to serve the request.  A web server with
> a good file caching system might have to do very few actual disk reads but
> whether it is faster to unpickle a compiled template object than to just
> re-compile a new one remains unknown.
> 
> If anyone has a suggestion for building a thread-safe set of precompiled
> templates, I'm all ears....
> 
> -----Original Message-----
> From: Hans-Jürgen Hay [mailto:hjh at alterras.de] 
> Sent: Thursday, December 14, 2006 9:50 AM
> To: Lee Brown; lxml-dev at codespeak.net
> Subject: Re: [lxml-dev] About lxml status
> 
> Dear Lee Brown,
> 
> I use lxml in the same context but their is an issue I like to warn you about,
> it is not possible to access global precompiled XSLT styles from different
> theads. But mod python uses multiple threads. The only solution I found up till
> now is to prevent mod_python from using multiple threads by globaly setting
> 
> PythonInterpreter somename
> 
> in the mod_python related apache config while using the prefork apache module or
> to build the style on each request new. If you see a better solution please tell
> me.
> 
> Regards
> Hans
> 
> 
> Am Donnerstag, den 14.12.2006, 08:51 -0500 schrieb Lee Brown:
> 
> I am currently using lxml in conjunction with Mod Python on an Apache web server
> to serve XML content data, merging dynamic data through Xincludes and
> transforming the output on-the-fly into XHTML using XSLT templates.  
> 



More information about the lxml-dev mailing list