Archive for March, 2007

Are Rails and Grails Scalable?

Wednesday, March 28th, 2007

Note: Some people keep complaining that I mistook “performance” with “scalability”. Please READ THE ARTICLE! I am talking about the performance *decreases* with increased number of threads. That is *scalability*. Please read before your comment on it again!

The short answer is no and here is why: Graeme Rocher, of the Grails fame, recently posted a simple benchmark comparison between Rails and Grails. While Grails beats Rails in the benchmark, it looks to me neither of them is scalable in a multi-core environment. From our internal tests, JBoss Seam easily out-performs both. ;)

Let me begin by saying that I admire Graeme’s coding skills — Grails is an excellent framework and JBoss Seam is built on many of the same ideas. But benchmark results like the following really do not bode well with Grails or Rails:

testD_overall.png

It shows that the overall throughput decreases significantly when Ruby processes increase from 1 to 10, or Tomcat threads increase from 10 to 25. From my own experience in performance testing, that is a tell-tale sign of CPU contention in synchronized code blocks or collection objects. CPU contention does not happen very often on single CPU machines. However, it happens a lot on multi-core (or multi-CPU) systems, which this benchmark is tested on. Basically the CPUs are all waiting to access a single block of synchronized code or object. If you do a JVM thread dump here (or something equivalent in Ruby), you will see most threads are waiting and the CPU load slowly creeps up to 100% as the backlog increases.

Another way to see the CPU contention is to look at application response times. When the CPUs start to wait upon each other, some threads would hang and produce extremely long response time for some requests. So, let’s look at Graeme’s response time graph. The max response times are indeed extremely long — consistent with hang threads. Actually, in this scenario, the mean value of the response time is meaningless since they are screwed by the long response times (i.e., the distribution is no longer normal). The median response time would be a much more robust gauge for user experience here.

testD_averages.png

Since the benchmark application itself is very simple, it is very unlikely that the contention point is in the application. It has to be in the framework or in the underlying application server. In JBoss, we try very hard to eliminate the contention points in the application server (and in Tomcat). As a result, frameworks like JBoss Seam can easily outperform Grails or Rails based on our internal tests (cannot publish numbers yet. Take my word with a grain of salt! ;)) … That is a huge benefit you get by choosing “mature” application servers. ;)

In any case, I wish the best for Grails. It is probably a minor contention point that show up big time in the CRUD tests. It should be resolved with a simple thread dump (or a profiler). I am sure Graeme will be able to find it and fix it very soon!

My Seam Talks in JavaOne 2007

Tuesday, March 20th, 2007

I am running two Seam-related BoFs on the first night of JavaOne 2007.

BOF-4400: Improve and Expand JavaServer Faces Technology with JBoss Seam
May 8th, 9pm, Hall E - 134 (Moscone Center)
By Michael Yuan and Kito Mann

BOF-9792: Rapid Seam Application Development with the NetBeans IDE
May 8th, 10pm, Gateway - 104 (Moscone Center)
By Michael Yuan and Petr Pisl

Come and chat with us if you are going to JavaOne!

In addition, Gavin is giving two technical sessions on Seam and WebBeans JSR. Make sure that you attend those too! :)

Texas is the best place for software developers

Monday, March 19th, 2007

According to this blog post, Texas is the best place to work for software developers. On average, software developers in Austin are paid $84,460 a year, ranking #9 in major US cities. Adjusted for cost-of-living, it goes up to $93,844 a year, ranking #2 among US cities. In fact, after adjusted for cost of living, 6 out of the 10 highest paying cities are in Texas.

Top 10 Cities for Salary Adjusted for Cost of Living (Software Developers)

1  	Houston  	 $ 102,908
2 	Austin 	         $  93,844
3 	Fort Worth 	 $  91,614
4 	Arlington 	 $  91,614
5 	El Paso 	 $  85,741
6 	Charlotte 	 $  85,477
7 	Dallas 	         $  84,489
8 	Jacksonville 	 $  81,928
9 	Colorado Springs $  81,850
10 	Atlanta 	 $  80,565

Top 10 Cities for Raw Average Salary (Software Developers)

1  	San Jose  	 $  99,250
2 	San Francisco 	 $  92,570
3 	Oakland 	 $  92,570
4 	Houston 	 $  89,530
5 	New York 	 $  89,370
6 	Boston 	         $  87,540
7 	Balitimore 	 $  86,110
8 	San Diego 	 $  85,280
9 	Austin 	         $  84,460
10 	Fresno 	         $  83,840

Speaking of cost of living, can we now compare cities in India and China? :)

Spring time in Austin Texas

Friday, March 16th, 2007

We have a pair of pear trees in our front yard. They are blooming in full force at this time of the year. Ju took some pictures today.

Tree and house:
DSC_4862.jpg

The two trees in our front yard:
DSC_4872.jpg

Flowers closeup:
DSC_4870.jpg

DSC_4867.jpg

Beating Rails in its own game (5-minute movie on Seam Eclipse Tools)

Wednesday, March 7th, 2007

Can you write a complete CRUD web application for 8 inter-linked database tables in 5 minutes? The application needs to support

* 1-1-, 1-n, n-n associations (navigation and search)
* Composite keys in tables
* Search on any column
* Paged search result list
* Automatic required input fields based on database schema
* AJAX-based input validation
* Rich UI widgets for Date/Time
* Ready-made access security infrastructure (just add login logic using Java code)
* Completely CSS and XHTML based layout

Now, can you do that with Java?

With the newly announced Red Hat Developer Studio and JBoss Seam, you can do all the above with a few mouse clicks! Here is a 5-minutes flash movie to illustrate how it is done:

Watch the Movie

If you prefer command line tools over GUI tools in Eclipse, the good news is that all the above features are available from command line ANT scripts as well. Checkout Seam Gen documentation.

The demo is a very small part of a 4-hour tutorial Ram Venkataraman, James Williams, Max Rydahl Andersen, and Max Katz put together for EclipseCon 2007. The complete tutorial covers JBoss Eclipse tools for server management, Seam Gen, database browsing, database query analyzer, Facelets visual editing, business process editor, rules editor, and much more. We will probably make the entire tutorial available online on JBoss web sites after we have a chance to polish it.