[Twisted-Python] Twisted performance?

Itamar Shtull-Trauring twisted at itamarst.org
Mon Oct 7 09:37:51 MDT 2002


On Mon, 7 Oct 2002 09:08:08 -0700 (PDT)
dave at pythonapocrypha.com wrote:

> I'd love to hear comments and performance numbers, even if they're just
> anectdotal. 

Twisted sustained performance is not all that great, especially from disk, but then we haven't really tried to optimize it that much. On the other hand, on my laptop (866 crusoe) it can do 160Mbit from disk (100 concurrent connections over loopback, using ab), but then it's a pretty slow machine. On a decent machine it'd probably do much better, and there are clear paths towards optimization - certainly we'd love it if you ported your optimizations to Twisted.

> Additionally (or as an alternative), if anyone can point me to
> some sample code I can run it against our internal performance tests - I'd
> be interested in (1) an HTTP server that serves just from memory (i.e.  
> returns a valid but large HTTP response of just random or junk data) and
> (2) an HTTP server that just serves a file or two from disk. In both cases
> the emphasis is on total throughput at varying numbers of concurrent 
> connections.

1. $ cp largefile /var/www/
   $ mktap web --path=/var/www
   $ twistd -f web.tap
   $ ab -n 300 -c 20 http://localhost:8080/largefile

2. Run attached script and run benchmarks against it. Seems rather slow, actually, compared to (1).

> P.S. Does Twisted support any sort of throughput throttling? (i.e. the 
> ability to cap [average] throughput at a certain level)

No, but it could be added pretty easily to things that use producer/consumer, I think (e.g. serving files).

-- 
Itamar Shtull-Trauring    http://itamarst.org/
Available for Python, Twisted, Zope and Java consulting
-------------- next part --------------
A non-text attachment was scrubbed...
Name: empty.py
Type: application/octet-stream
Size: 1060 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20021007/d60a3118/attachment-0002.obj>


More information about the Twisted-Python mailing list