[Zope3-dev] Re: URGENT RFC: Is anyone using response.write in Zope 3?

Jim Fulton jim at zope.com
Sat Dec 31 01:52:46 EST 2005


Shane Hathaway wrote:
> Shane Hathaway wrote:
> 
>> Philipp von Weitershausen wrote:
>>
>>> So using write() once doesn't at all seem like an advantage over simply
>>> returning the data...
>>
>>
>> The interesting part is behind the scenes.  If the response is large 
>> enough (it's an adjustable threshold), the response transparently gets 
>> sent to a temporary file.  If the load on the server doesn't allow
>> all the responses to fit in RAM, temporary files are an advantage 
>> because they allow the kernel to help manage the memory.  (CPython's 
>> manner of using memory makes it hard for the kernel to page most 
>> memory held by Python processes.)
> 
> 
> Now that I've brought more of this issue back into my head, I remember 
> that the advantage I just spoke of is independent of response.write(). 
> However, there was still an advantage if a response is large enough that 
> it doesn't comfortably fit in RAM.  response.write() allowed the 
> application to write the response in pieces, giving the kernel an 
> opportunity to swap out the response data immediately rather than 
> thrash.  If Zope 2's ZServer didn't have this feature, zope.org would 
> crawl even worse than it does now.  I know this because of some zope.org 
> debugging sessions.

You are confusing Zope 2 and Zope 3.  Zope 2's response.write
does handle large output effciently, Zope 3's did not.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list