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@gocept.com - phone +49 345 122 9889 7 - fax +49 345 122 9889 1 - zope and plone consulting and development