Friday, March 23, 2007

Grails vs. Rails Benchmark

This article:

Prompted me to do this:

Feedback welcome.

I must stress this is not meant to be a flame war inciting benchmark, it has been done merely to allay the aforementioned bloggers fear that he expresses in this comment:

"Surely someone close to the respective projects has asked these hard questions of themselves?

Because I know the previous paragraph has to, has to, be true, then I can only assume one thing: someone has done this as an exercise...and the results were depressing. Why else would the results not be published? If Groovy or Grails was faster, even slightly so, then you can bet it would trumpeted far and wide. The fact that it's not leaves an unsettling feeling."


Stephan.Schmidt said...

Well, as a Grails enthusiast:

Rails isn't very fast and will get faster with a better VM. So this isn't very good looking for Grails I think.

On the other hand, there has been no optimization in Grails, the database is a limiting factor for both, scalability as mentioned with Terracotta should be good (could this move into Grails? :-)

What this test achieved though is that people don't need to be afraid when moving from Rails to Grails or when starting Grails development (I never was :-)

BUT if you want to be fast on Grails, why use MySQL? The fastest option for Java websites should be to use a Java DB (an option not available for Rails, at least if you don't use JRuby) like HSQL, Derby or (the fastest?) H2.

A test with H2 embedded should be really interesting and involves only changing the JDBC connection url :-)

Stephan.Schmidt said...

I forgot to add

(H2 being 5-10 times faster embedded than MySQL client/server)

james_027 said...

How is an embedded db differ from a client/server?

Anonymous said...

Embedded is usually faster because there is no need for TCP/IP communication with the database server. Instead the database server process (or thread) lives inside the web server, in this case, and the communication happens using regular function calls.

Paul Barry said...

I posted this over on Marc Palmer's blog, but I thought I cross post it here to make sure you can see it:

A rails application is not threaded like a Java app. What this means is that when you only have 1 mongrel process, all requests must be processed serially. This is not true for 1 tomcat instance. Since tomcat is a java app, it is threaded and process multiple requests at once, when gives it better performance under a concurrent load.

The way you handle more concurrent requests with a Rails app is to run multiple mongrel instances (on the same server, a different port for each) using mongrel_cluster. Then you use something like Apache 2.2’s mod_proxy_balancer to load balance the requests across the multiple mongrel instances.

It would be interesting to see these tests run again with mongrel_cluster running 2, 4, 6, 8, et.c instances to see what impact that would have. for this kind of test, I would guess that it actually wouldn’t be a tremendous boost, because each requests should be very fast. But when testing requests that can take longer than a few milliseconds, especially where uploading or downloading of large amount of data is concerned, the performance difference would probably be huge with using multiple mongrel instances.

Graeme Rocher said...

Hi Paul,

I've taken the advice of the Rails community and benchmarked with 10 mongrel instances and Pound as a load balancer.

I also configured Grails to have only 10 tomcat threads. However, in my tests Rails' performance degraded for most tests and Grails' improved.

Graeme Rocher said...

The updated benchmarks are here:


Anonymous said...

I'd suggest you run with nginx or mod_proxy_balancer or lighttpd with fair balance. This may not yield any better results, but few people suggest using pound now days.

Your benchmarks looks interesting and wonderful, but Ruby and Rails still do everything I ask them to, on any scale; I'll stick with Ruby. If speed was a problem for me and Rails, I'd appreciate this benchmark more.

Julian Klappenbach said...

Saying that performance is hindered by a full featured database is a bit disingenuous, as real production environments are not going to use in memory datastores. However, the commentary should also include the fact that Grails should be able to take advantage of the 2nd level caches implemented by the top JPA contenders, including Hibernate and Toplink. These caches not only provide read optimization for a single node, but are designed to be distributed throughout a cluster. The latter is more significant when considering that horizontal scalability is the key to a solid, load tolerant, highly available environment.

The fact that Grails stands on the backs of such software components as Hibernate, Swing, and Quartz is a pedigree that deserves serious consideration. Each of these projects, on their own, represent years of R&D and an evolution over nearly a decade to deliver best-of-breed.

Honestly, I thank Ruby on Rails and 37 signals for showing how unnecessarily complicated the lives of application developers have been. But in terms of tried and true solutions, it's hard to ignore the experience of Java. And that's precisely what Groovy and Grails allows us to capitalize.

I'm not trying to suggest that Ruby on Rails can't someday meet the stringent requirements set by large scale enterprise applications, but Java is here and now.

Anonymous said...

runescape money
runescape gold
runescape money
runescape gold
buy runescape gold buy runescape money runescape items
runescape accounts
runescape gp
runescape money
runescape power leveling
runescape money
runescape gold
dofus kamas
cheap runescape money
cheap runescape gold
Guild Wars Gold
buy Guild Wars Gold
lotro gold
buy lotro gold
lotro gold
buy lotro gold
lotro gold
buy lotro gold

Hellgate Palladium
Hellgate London Palladium
Hellgate money
Tabula Rasa gold tabula rasa money
Tabula Rasa Credit
Tabula Rasa Credits
Hellgate gold
Hellgate London gold
wow power leveling
wow powerleveling
Warcraft PowerLeveling
Warcraft Power Leveling
World of Warcraft PowerLeveling World of Warcraft Power Leveling runescape power leveling
runescape powerleveling
eve isk
eve online isk
eve isk
eve online isk
tibia gold
Fiesta Silver
Fiesta Gold
Age of Conan Gold
buy Age of Conan Gold
aoc gold

china tour
beijing tour
beijing travel
china tour
tibet tour
tibet travel
computer monitoring software
employee monitoring

Anonymous said...

I always heard something from my neighbor that he sometimes goes to the internet bar to play the game which will use him some hero gold,he usually can win a lot of hero online gold,then he let his friends all have some hero online money,his friends thank him very much for introducing them the hero money,they usually buy hero gold together.

Anonymous said...

Do you know the Atlantica online Gold, in the game you need the Atlantica Gold. it can help you increase your level. My friends always asked me how to buy Atlantica online Gold, i do not know he spend how much money to buy the Atlantica online money, when i see him in order to play the game and search which the place can buy the cheap Atlantica online Gold. i also happy with him.

Anonymous said...

Buy Warcraft(wow power leveling)please point machine (wow power leveling)to enter the website(wow power leveling)of Warcraft

Anonymous said...

^^ nice blog!! ^@^

徵信, 徵信網, 徵信社, 徵信社, 感情挽回, 婚姻挽回, 挽回婚姻, 挽回感情, 徵信, 徵信社, 徵信, 徵信, 捉姦, 徵信公司, 通姦, 通姦罪, 抓姦, 抓猴, 捉猴, 捉姦, 監聽, 調查跟蹤, 反跟蹤, 外遇問題, 徵信, 捉姦, 女人徵信, 女子徵信, 外遇問題, 女子徵信, 外遇, 徵信公司, 徵信網, 外遇蒐證, 抓姦, 抓猴, 捉猴, 調查跟蹤, 反跟蹤, 感情挽回, 挽回感情, 婚姻挽回, 挽回婚姻, 外遇沖開, 抓姦, 女子徵信, 外遇蒐證, 外遇, 通姦, 通姦罪, 贍養費, 徵信, 徵信社, 抓姦, 徵信, 徵信公司, 徵信社, 徵信公司, 徵信社, 徵信公司, 女人徵信,

徵信, 徵信網, 徵信社, 徵信網, 外遇, 徵信, 徵信社, 抓姦, 徵信, 女人徵信, 徵信社, 女人徵信社, 外遇, 抓姦, 徵信公司, 徵信社, 徵信社, 徵信社, 徵信社, 徵信社, 女人徵信社, 徵信社, 徵信, 徵信社, 徵信, 女子徵信社, 女子徵信社, 女子徵信社, 女子徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信社,

徵信, 徵信社,徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 外遇, 抓姦, 離婚, 外遇,離婚,

徵信社,徵信, 徵信社, 徵信, 徵信社, 徵信,徵信社, 徵信社, 徵信, 外遇, 抓姦, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信社, 徵信社, 徵信社,徵信,徵信, 徵信, 外遇, 抓姦

Anonymous said...

看房子,買房子,建商自售,自售,台北新成屋,台北豪宅,新成屋,豪宅,美髮儀器,美髮,儀器,髮型,EMBA,MBA,學位,EMBA,專業認證,認證課程,博士學位,DBA,PHD,在職進修,碩士學位,推廣教育,DBA,進修課程,碩士學位,網路廣告,關鍵字廣告,關鍵字,課程介紹,學分班,文憑,牛樟芝,段木,牛樟菇,日式料理, 台北居酒屋,日本料理,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,台北結婚,場地,住宿,訂房,HOTEL,飯店,造型系列,學位,SEO,婚宴,捷運,學區,美髮,儀器,髮型,看房子,買房子,建商自售,自售,房子,捷運,學區,台北新成屋,台北豪宅,新成屋,豪宅,學位,碩士學位,進修,在職進修, 課程,教育,學位,證照,mba,文憑,學分班,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,場地,結婚,場地,推車飲茶,港式點心,尾牙春酒,台北結婚,婚宴場地,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,場地,居酒屋,燒烤,美髮,儀器,髮型,美髮,儀器,髮型,美髮,儀器,髮型,美髮,儀器,髮型,小套房,小套房,進修,在職進修,留學,證照,MBA,EMBA,留學,MBA,EMBA,留學,進修,在職進修,牛樟芝,段木,牛樟菇,關鍵字排名,網路行銷,PMP,在職專班,研究所在職專班,碩士在職專班,PMP,證照,在職專班,研究所在職專班,碩士在職專班,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,EMBA,MBA,PMP
,在職進修,專案管理,出國留學,EMBA,MBA,PMP,在職進修,專案管理,出國留學,婚宴,婚宴,婚宴,婚宴,漢高資訊,漢高資訊,比利時,比利時聯合商學院,宜蘭民宿,台東民宿,澎湖民宿,墾丁民宿,花蓮民宿,SEO,找工作,汽車旅館,阿里山,日月潭,阿里山民宿,東森購物,momo購物台,pc home購物,購物