[Twisted-web] static file performance
Michał Pasternak
michal.dtz at gmail.com
Fri Mar 7 11:02:52 EST 2008
Dnia 2008-03-04, o godz. 21:54:22
Thomas Hervé <therve at free.fr> napisał(a):
> Phil Christensen a écrit :
> > Hi All,
> >
> > The previous thread about http server performance made me think of
> > something I've been meaning to ask about for a while.
> >
> > 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.
> >
> > I've just been using Apache to serve static content, but I'd love
> > to be able to use a pure-twisted solution.
>
> If you use a supported platform (Linux, FreeBSD, maybe Leopard),
> sendfile is the best way to get close to Apache performance on static
> files. The ticket #585 (http://twistedmatrix.com/trac/ticket/585) is
> where we try to do that. Unfortunately, this is a huge change, so it
> requires huge energy to get it into Twisted :). So any help on this
> ticket would be great: reviews, adding tests, performance measures,
> etc...
Also I'd suggest taking a look at lighttpd - C source is pretty clear,
and one of many possible solutions is using async I/O on mmaped shared
memory. If you ask me, I'd rather try to find a clean way of using
lighttpd with Twisted Web, like a caching reverse proxy :)
Regards,
--
m
More information about the Twisted-web
mailing list