[Zope-dev] Patch: let non-seekable streams be input for
ZPublisher (updated)
Ames Andreas (MPA/DF)
Andreas.Ames at tenovis.com
Mon Aug 23 14:58:34 EDT 2004
Hello,
Dieter Maurer wrote:
> Maybe, I have a much simpler solution:
>
> Something in ZServer makes all file fields seekable by
> delivering them through some temporary (either a StringIO
> or a temporary file).
>
> Maybe, you could do the same for your requests?
Yes, I could. But trying to avoid it was the very reason I tried to
patch HTTPRequest for.
What you propose is what the HTTPServer does for instance. I have at
least two objections:
1) For big requests (big means some hardcoded threshold) HTTPServer
buffers the request on disk. Then ZPublisher creates a
FieldStorage instance which will write the request once again to
disk. And that also means the request is read from disk several
times. That's a bit too much blocking disk I/O in a production
webserver for my liking. And that's not counting retries; each
retry will add another pair of blocking disk I/O in the current
implementation. What I'm trying to do is:
- avoid unneeded disk I/O in retries
- make it possible that self.stdin in HTTPRequest can be
non-seekable such that it doesn't have to be buffered on disk
before FieldStorage is created (and does exactly that buffering).
2) I'm convinced that the one and only ZServer thread should do
without any blocking (I/O) call (besides select() that is) and I
want AJPServer also be an experiment to see if this improves
performance.
cheers,
andreas
More information about the Zope-Dev
mailing list