[Zope-dev] Serving big files thru zope?

Dieter Maurer dieter at handshake.de
Mon Mar 1 14:43:08 EST 2004


Dario Lopez-Kästen wrote at 2004-3-1 08:24 +0100:
> ...
>Is the current state of ZServer such that it is suboptimal for serving 
>large files? if so,
>
>a) what is the problem with the current implementation?

In order to reduce memory consumption and decouple Zope from
ZServer (and the response delivery), a large file
is spooled via a temporary.

This means, that the file content is read from ZODB, stored
in a temporary file and then delivered from this temporary file.

At least, when your client has a high bandwidth to your server,
this serving through a temporary file is a waste.

Serving static content via Python/Zope is about one order
of magnitude slower than serving the same static content
via Apache.

>b) is there a fix available?

Probably, but it will be a lot of work:

  When your client (or its connection) is slow, you
  want to spool large files indirectly (to free the
  scares Zope worker thread soon).
  Only when you know your client is fast, would you want
  to serve directly.
  An adaptive scheme is possible but much more demanding
  than the simple schema (to use a temporary file for
  all sufficiently large content).

  You could code ZServer in "C" and speed it up thereby.
  Maybe "psyco" helps a bit?

-- 
Dieter



More information about the Zope-Dev mailing list