[Twisted-web] Re: static file performance

Phil Christensen phil at bubblehouse.org
Tue Mar 4 19:37:39 EST 2008


On Mar 4, 2008, at 7:13 PM, David Bolen wrote:
> Phil Christensen <phil at bubblehouse.org> writes:
>> What is the best way to send static files to the client in
>> twisted.web? I know web2 had some preliminary support for mmap for
>> small files, but I know it didn't work the last time I checked, and
>> I'm trying to stick with twisted.web for now, anyways.
[snip snip snip]
> To be honest, while I'm sure there's a measurable overhead to serving
> static content through Python/Twisted rather than a front end server
> like Apache, I've never seen it be an issue.  Certainly streaming
> large files are going to be more I/O bound than CPU bound anyway.

Thanks for the tips, but I'm pretty well up to speed on the existing  
static file mechanisms. My big concern was performance, though.

Obviously it depends on the site in question. My current project has  
a large number of external assets of varying kinds, and informal  
JMeter testing is showing that serving static content separately  
improves throughput greatly, almost by an order of magnitude.

This actually makes me question whether sendfile would make much of a  
difference; considering it would only be used for files over 5MB. The  
external assets that I'm serving with Apache are all Javascript/CSS/ 
images, with some miscellaneous PDF/PPT/DOC/etc files.

For me right now, this is all just academic, anyways, since my  
current deployment setup is working just fine for me, but I'll try to  
generate some relevant stats to illustrate this later on.

Thanks all for your input,

-phil



More information about the Twisted-web mailing list