[Twisted-Python] Speed of twisted on Amazon EC2
Tom van Neerijnen
twisted at tomvn.com
Sun Apr 21 16:27:58 EDT 2013
Thank you Gelin, as you suggested I benchmarked again on PyPy and am very
impressed with it. It was significantly quicker, beating node by a fair
margin on a higher concurrency. I pasted some results in another reply in
this same thread.
On Sun, Apr 21, 2013 at 4:26 PM, Gelin Yan <dynamicgl at gmail.com> wrote:
> On Sun, Apr 21, 2013 at 8:36 PM, Tobias Oberstein <
> tobias.oberstein at tavendo.de> wrote:
>> which OS are you running on your EC2 instance? Amazon Linux?
>> Which reactor are you running your Twisted test with? Epoll?
>> Are you running on CPython or PyPy?
>> Can we see you Twisted hello world test app?
>> Mit freundlichen Grüßen,
>> Tobias Oberstein
>> +49(0)9131 940 3574
>> +49(0)176 23 752 055
>> tobias.oberstein at tavendo.de
>> Skype: toberstein
>> Twitter: @oberstet
>> Xing: Tobias Oberstein
>> Tavendo GmbH · Am Weihersbach 13 · 91074 Herzogenaurach · Deutschland
>> Office / Postanschrift : Waldstrasse 18 · 91054 Erlangen · Deutschland
>> +49(+)700 GO TAVENDO · +49(0)700 46 828 36 36 · www.tavendo.de
>> Amtsgericht Fürth · HRB 10365 · USt-Id.Nr DE246462916 · Geschäftsführer
>> Tobias Oberstein
>> Von: twisted-python-bounces at twistedmatrix.com [mailto:
>> twisted-python-bounces at twistedmatrix.com] Im Auftrag von Tom van
>> Gesendet: Sonntag, 21. April 2013 12:58
>> An: twisted-python at twistedmatrix.com
>> Betreff: [Twisted-Python] Speed of twisted on Amazon EC2
>> Hi all
>> I recently wrote a hello world HTTP app in Twisted, Cyclone, node, Go and
>> Scala on the Play framework, and used a combination of ab and gattling to
>> see how fast each was on an m1.small instance on Amazon EC2. I also tested
>> it on bare metal (my laptop:)) but I'll get to that later.
>> The code I used for twisted was the web server code sample from the front
>> page of twistedmatrix.com with the numberRequests increment dropped and
>> a simple "Hello World!" returned instead.
>> For cyclone I used the sample code from the cyclone docs with the same
>> string being returned.
>> Node was the sample from their front page.
>> Play and Go I've never worked with before so those were copy pastes from
>> various examples on their pages but again same URI and return string as the
>> other frameworks.
>> From one m1.small to another, Go, Play and node were handling about 1.5k
>> requests per second while Twisted and Cyclone were only handling 400-500
>> requests per second.
>> On loopback from the same m1.small I suspect I was starting to load test
>> the load testers more than the apps but locally all the frameworks were
>> performing similarly.
>> Load testing from another machine to my laptop I was seeing far better
>> performance from Twisted and Cyclone, both doing closer to 2k requests per
>> second. The other frameworks were only a little quicker but again, there's
>> a chance the machine running the load tests was the bottle neck.
>> These tests were very unscientifically done but I still wasn't expecting
>> to see such a big difference between specifically node and Twisted. 500
>> req/sec is plenty quick for 90% of what I do and of course I know there's
>> so much more to an application than returning hello world but I was
>> wondering if I was missing some trick to speed Twisted up to get close to
>> the others on EC2.
>> Twisted-Python mailing list
>> Twisted-Python at twistedmatrix.com
> I suggest trying pypy. python actually is quite slow with lots of
> function calls. I did have a benchmark for cyclone & pypy. it is almost 3
> times faster. twisted can work with pypy well so you definitely should give
> it a try.
> gelin yan
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python