Note that there are some explanatory texts on larger screens.

plurals
  1. POIs performance of Grails 2.0 really that awfully low?
    primarykey
    data
    text
    <p>I'm somewhat newbie for WEB development based on JVM stack, but future project will require specifically some JVM-based WEB engine. So I started looking on some ground to make things quickly and turned to try Grails. Things looked good from the book, but beeing impressed by really long startup time (grails run-app) I decided to test how this works under load. Here it is:</p> <ul> <li><p>test app: follow few instruction here to make it from ground (takes 2 mins assuming you already have Grails and Tomcat installed): </p> <p>_http://grails.org/Quick+Start</p></li> <li><p>test case (with Apache benchmark - comes with Apache httpd - _http://httpd.apache.org):</p> <p>ab.exe -n 500 -c _http://localhost:8080/my-project/book/create <br/> (Note: this is just displays 2 input fields within styled container)</p></li> <li><p>hardware: Intel i5 650 (4Core*3.2GHz) 8GB Ram &amp; Win Server 2003 x64</p></li> </ul> <p>The result is ..</p> <p><b>Grails: 32 Req/Sec</b></p> <pre><code>Total transferred: 1380500 bytes HTML transferred: 1297500 bytes Requests per second: 32.45 [#/sec] (mean) Time per request: 308.129 [ms] (mean) Time per request: 30.813 [ms] (mean, across all concurrent requests) Transfer rate: 87.51 [Kbytes/sec] received </code></pre> <p>(Only 32 Req/Sec with 100% of CPU saturation, this is a way too below my expectations for such hardware)</p> <p>... Next - i tried to compare it for example with similar dummy JSF application (i took one here: _http://www.ibm.com/developerworks/library/j-jsf2/ - look for "Source code with JAR files", there is \jsf-example2\target\jsf-example2-1.0.war inside),</p> <ul> <li>test case: ab.exe -n 500 -c 10 _http://localhost:8080/jsf/backend/listing.jsp</li> </ul> <p>The result is ..</p> <p><b>JSF: 400 Req/Sec</b></p> <pre><code>Total transferred: 5178234 bytes HTML transferred: 5065734 bytes Requests per second: 405.06 [#/sec] (mean) Time per request: 24.688 [ms] (mean) Time per request: 2.469 [ms] (mean, across all concurrent requests) Transfer rate: 4096.65 [Kbytes/sec] received </code></pre> <p>... And finally goes raw dummy JSP (just for reference)</p> <p><b>Jsp: 8000 req/sec:</b></p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;% for( int i = 0; i &lt; 100; i ++ ) { %&gt; Dummy Jsp &lt;%= i %&gt; &lt;/br&gt; &lt;% } %&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Result:</p> <pre><code>Total transferred: 12365000 bytes HTML transferred: 11120000 bytes Requests per second: 7999.90 [#/sec] (mean) Time per request: 1.250 [ms] (mean) Time per request: 0.125 [ms] (mean, across all concurrent requests) Transfer rate: 19320.07 [Kbytes/sec] received </code></pre> <p>...</p> <p><b>Am i missing something?</b> ... and Grails app can run much better?</p> <p>PS: I tried profiling my running Grails app with VisualVM, but got endless loop of messages like ...</p> <pre><code>Profiler Agent: Redefining 100 classes at idx 0, out of total 413 ... Profiler Agent: Redefining 100 classes at idx 0, out of total 769 ... </code></pre> <p>And finally app just stopped working after few mins - so, looks like profiling Grails is no the choice for good diagnose.</p> <p><b>Update</b> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - </p> <p>First of all I have to admin, yes i need to RTFM - i.e. 'grails run-app' is not the correct way to run Grails for performance measurement. After compiling WAR and deploying it to Tomcat performance is not that awfully low - it is just low. The metrics below are for concurrency of 1 user (I just wanted to check what is MAX performance of the framework in one thread and with no heavy load) and while reading other related posts here i came to "http://stackoverflow.com/questions/819684/jsf-and-spring-performance-vs-poor-jsp-performance" and decided to check Apache Wicket mentioned there - its performance is also included.</p> <p>Use case is: - ab.exe -n 500 -c 1 _http://localhost:8080/... - server is Tomcat7 in vFabric tcServer Dev edition with 'insight' running on background</p> <pre><code>---------------------- tcServer Plain Tomcat 7 -c 10 /Grails/book/create 77 req/sec 130 req/sec 410 req/sec /jsf/backend/listing.jsp 133 req/sec 194 req/sec 395 req/sec /wicket/library/ 870 req/sec 1400 req/sec 5300 req/sec </code></pre> <p>So ... anyway there is something wrong with Grails. I have made some profiling using tcServer (thanks Karthick) - it looks like it is able only to trace 'Spring-based' actions and internal stacktrace for Grails is like following (for 2 requests - note: metrics are not stable - i bet accuracy of tcServer far from beeing perfect, but can be used just for inforamtion)</p> <pre><code>Total (81ms) Filter: urlMapping (32ms) -&gt; SimpleGrailsController#handleRequest (26ms) -&gt; Render view "/book/create" (4ms) Render view "/layouts/main.gsp" (47ms) Total (79ms) Filter: urlMapping (56ms) -&gt; -&gt; SimpleGrailsController#handleRequest (4ms) -&gt; Render view "/book/create" (38ms) Render view "/layouts/main.gsp" (22ms) </code></pre> <p>PS: it may happen that the root cause for bad performance in Grails are underlying 'Spring' libs, will check this in more details.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload