Weblog

Performance test results

Some folks benchmarked three Web frameworks: Symfony (PHP), Ruby on Rails and Django. They found Django to be the fastest:

Rails performed much better than Symfony. And Django performed much better than Rails.

Granted, the nature of Web frameworks makes it difficult to make this an apples-to-apples test. But, as the benchmarkers themselves say, "We feel these results, though not the whole picture, offer hints about relative performance between the three frameworks/platforms."

To be honest, these results doesn't come as a surprise to us Django developers. We've been performance-conscious from the very start, and performance concerns guide us at every level -- from the template system to URL parsing to database access. (A good example of how performance-crazy we are is the new USE_I18N setting, unveiled last week, which turns off internationalization overhead if you're not using it.)

Get the word out! How about posting this to del.icio.us and Digging it?

Posted by Adrian Holovaty on July 14, 2006

Comments

SuperJared July 14, 2006 at 1:34 p.m.

The benchmark link doesn't work -- the plus sign in the URL kills it.

Here's the correct URL: http://wiki.rubyonrails.com/rails/pag...

Adrian Holovaty July 14, 2006 at 1:37 p.m.

Thanks, SuperJared! I've fixed the link.

SuperJared July 14, 2006 at 2:53 p.m.

Odd, it seems to generate the same "Precondition Failure" -- not sure why.

Wade July 14, 2006 at 2:57 p.m.

Now this one works again:

http://wiki.rubyonrails.com/rails/pag...

Adrian Holovaty July 14, 2006 at 2:57 p.m.

Weird. Maybe the Rails-powered wiki can't handle the traffic? ;-)

Jake July 14, 2006 at 3:06 p.m.

Hrm, I couldn't get any of the listed URLs to work. Maybe its a conspiracy?!

AlexL July 14, 2006 at 4:07 p.m.

I found that Rails wiki checks HTTP-referer or cookie.
Going to http://wiki.rubyonrails.com/rails and then going to http://wiki.rubyonrails.com/rails/pag... will bring you to article while goind to second address dicectly will result in HTTP 412

Per July 14, 2006 at 4:15 p.m.

I think i works if you try it without http:

wiki.rubyonrails.com/rails/pages/Framework+Performance

Mike Watkins July 14, 2006 at 4:48 p.m.

Perhaps we can thank Python almost as much as web frameworks for the relative performance differences. I quickly mocked up what should be a similar (spartans to macs level) test.

Dual proc (much slower than the machine they benchmarked on) 1.26Ghz PIII w 3GB RAM, fast scsi.

Software: QP web framework / Durus database; probably a fair computational similarity - template, xhtml, some computation per page, slightly larger page size (~ 2300 bytes vs 1340 for their test):

Transactions: 41286 hits
Availability: 100.00 %
Elapsed time: 180.02 secs
Data transferred: 90.83 MB
Response time: 0.65 secs
Transaction rate: 229.34 trans/sec
Throughput: 0.50 MB/sec
Concurrency: 149.68
Successful transactions: 41286
Failed transactions: 0
Longest transaction: 6.88
Shortest transaction: 0.00

Not too bad. Arguably its doing a lot less under the covers than django is, but I imagine most of the difference is in the data access. Durus and ZODB are really fast when they meet your needs.

Regardless, if faced with a choice between Rails and PHP most of us would chose the former and for good reason.

Its a good time to be a web developer and a great time to be a python web developer.

Mike Watkins July 14, 2006 at 4:51 p.m.

ps that was a 3 minute siege, 150 concurrency, gzip compression off.

siege -b -c150 -t180S http://localhost/cookbook/beansalad/

GoneWacko July 14, 2006 at 8:49 p.m.

Localhost strikes again

Anonymous July 15, 2006 at 10:52 a.m.

Per's link to the article seems to work. Of course, I believe the link problem should be seen as yet more evidence that Django's philosophy about proper/pretty URL's is the right idea ;-)

pythy July 16, 2006 at 6:13 a.m.

URL: http://wiki.rubyonrails.com/rails/pag...

(slash at end)

Colin July 16, 2006 at 11:42 a.m.

Crude spam-protection in action at the rails wiki ;)

Piotr July 16, 2006 at 4 p.m.

I've used httperf and got nice results:
http://www.cms.rk.edu.pl/benchmark.html

Anders July 16, 2006 at 10:23 p.m.

The link to the rails wiki fails when the space in 'Framework Performance' is encoded as a '%20' rather than a '+'. The rails wiki then has some sort of validation code that's probably expecting page names to be only alphanumerics and '+'s with no weird punctuation like '%' so it's failing.

The code on this blog is probably normalizing all the linked urls to use '%20' for the space. That's probably not the *best* thing it could be doing since it's changing urls (and it shouldn't be normalizing away the '+' since it's in a path, not in a query string) but the Rails wiki also shouldn't be using '+' outside of a query string according to rfc1738.

Anders July 16, 2006 at 10:34 p.m.

As a test of my theory, i think this url should work: http://wiki.rubyonrails.org/rails/pag...

(just encoding the '+' as '%2B')

zyegfryed July 17, 2006 at 3:24 a.m.

This one http://wiki.rubyonrails.org/rails/pag... works fine to me (Opera 9)

Todd July 17, 2006 at 10:53 a.m.

Speaking of performance, is there a variable available in the framework that prints out the amount of time it took to generate the page?

Adrian Holovaty July 17, 2006 at 1:26 p.m.

Todd: Nope, we don't keep track of that -- unneeded overhead. You could write a piece of middleware that does that, though.

Stu Hood July 17, 2006 at 9:07 p.m.

http://zilbo.com/@perfmon should do the trick!

__SERF__ July 19, 2006 at 2:48 p.m.

The tests have been completely ripped apart and discredited by the mongrel author Zed Shaw. (see that article)

leave out the http:// part in the url and you can get to it through Firefox

pk July 20, 2006 at 3 p.m.

hey __SERF__
where is the article you mentioned?

thanks,
pk

__SERF__ July 20, 2006 at 8:47 p.m.

@pk : I meant cut and paste the following in the address bar:

wiki.rubyonrails.org/rails/pages/Framework+Performance

Grumpy July 21, 2006 at 3:50 p.m.

I'm not sure why people are still whacking on the URL -- the issue is referer checking on the Rails wiki servers, as Alex pointed out on July 14th. Any of these URLs work if you copy and paste them into a new browser window. You don't have to remove "http://" or anything else. Bah humbug!

mlody July 24, 2006 at 9:49 p.m.

here is VALID link:
http://wiki.rubyonrails.com/rails/pag...

Darryl Ring July 24, 2006 at 10:51 p.m.

I love how everybody keeps posting "100% definitely valid link!" and a hyperlink with the exact same URI as in the original post--they don't work.

Tapiwa July 28, 2006 at 4:52 a.m.

Darryl, say it with me.... They are all ignant.

yell August 10, 2006 at 3:11 a.m.

comon somebody, find a good link

Rui Barreiros August 16, 2006 at 11:42 a.m.

Don't bother, I worked with both frameworks, Django and Symfony, and, besides those benchmarks being completely useless due to the complete lack of knowledge of the testers into even configuring a proper database connection, they clearly show the lacking of knowledge into properly configuring any of the frameworks tested into a production environment.

As i stated there, those benchmarks are ridiculous.

Mothra February 6, 2007 at 10:54 p.m.

Recent performance roundup:
http://www.alrond.com/en/2007/jan/25/...

Boris September 29, 2007 at 5:26 p.m.

Here is presentation (video also available) about Django and how it is used in russian search engine yandex.ru. Presentation is in Russian but you can translate it with Google translate
http://www.rit2007.ru/paper_view.html...

Comments are closed

To prevent spam, comments are no longer allowed after sixty days.