[Zope-dev] Early processing of request body (was: Proposal for optimized Blob handling)

Christian Theune ct at gocept.com
Wed Mar 7 16:05:54 EST 2007


Hi,

Am Mittwoch, den 07.03.2007, 21:48 +0100 schrieb Dieter Maurer:
> Christian Theune wrote at 2007-3-7 20:09 +0100:
> >I was looking through some publisher code and found that the
> >`process_request` method which takes the request body as a file-like
> >object and processes it as a FieldStorage happens within the application
> >thread.
> >
> >This would be better if it happened beforehand because it can takes up
> >time while a transaction is running and a thread is used although it
> >doesn't require any application-specific code.
> 
> In my view, it already now happens far too early, because 
> it may raise exceptions and those exceptions are not handled
> by the "standard_error_message" usually used for error processing
> depending on the url.
>
> 
> Therefore, if you move out things, you should take care that
> you move out only parts that cannot raise exceptions.

Ah. Interesting point!

> Furthermore, you seem to propose to move work from a worker thread
> to the IO (i.e. "ZServer") thread. I do not think that it is a good idea to
> put significant work on the IO thread.
> 
> Note, that the IO thread is responsible to handle all IO.
> When you keep it busy with other tasks, it will not handle IO...

Right. This optimization is about leveraging the fact that in many
situations the upstream bandwith is *much* lower than the IO bandwith to
the disk.

Another condition that I have (and I think this is the general pattern)
is that application threads should be given back to the pool as quickly
as possible.

If 5 seconds are spend in the application thread to untangle mime data
which has nothing application-specific about it and then only 100ms or
so in the application itself, I'd say there is a major overhead problem.

Christiabn

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20070307/31ca0cef/attachment.bin


More information about the Zope-Dev mailing list