On Dec 21, 2010, at 2:24 PM, exarkun@twistedmatrix.com wrote:

Instead, you have to go all the way to producers/consumers, and only write more data to the transport buffer when it has finished dealing with what you previously gave it.

While everybody should of course use producers and consumers, I feel like there should be a twisted core ticket for this behavior of transport buffering, and a twisted web ticket for this behavior of the request buffering.  The naive implementation _could_ be much cheaper memory-wise; at the very least, twisted.web.static.Data ought to do the smart thing.

Would there be some deleterious effect to another usage pattern to fixing this?  AFAIK there's no network in the world where you'll ever _actually_ be able to send more than about 64k in one send() anyway, and Twisted doesn't even try to do more than 128k (c.f. twisted.internet.abstract.FileDescriptor).