Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails 2.0 run-app very slow performance

I'm using Grails 2.0. I used to develop under Grails 1.3.7 but when running an application under Grails 2.0 the performance is very slow. A page can take more than 30 seconds to show and it's very embarrassing and unproductive.

I googled and I found that GSPs in 2.0 are in some cases 10 times slower than 1.3.7 ; Greame explained that there is a new way of handling GSPs in dev mod, but when executing grails prod run-app I have almost the same problem.

What should I do to speed up development process ? I'm loosing too much time.

PS : My GRAILS_OPTS are "-‬server‭ -‬Xmx600M‭ -‬Xms600M‭ -‬XX:MaxPermSize=250m‭ -‬Dfile.encoding=UTF-8 -Dserver.port=9090‭"‬

like image 458
Houcem Berrayana Avatar asked Sep 27 '12 10:09

Houcem Berrayana


1 Answers

I posted an small announcement on the mailing list about 20 minutes ago: http://grails.1312388.n4.nabble.com/GSP-Compilation-tt4632864.html#a4635595

This issue was fixed: http://jira.grails.org/browse/GRAILS-9423

Please test the performance of the latest 2.1.x snapshot build.

Try these

export GRAILS_OPTS="-server -noverify -XX:PermSize=256m
-XX:MaxPermSize=256m -Xmx600M -Xms600m -XX:+UseParallelGC -Djava.net.preferIPv4Stack=true 
-Dsun.reflect.inflationThreshold=100000"

For me, the trick was to set Xmx and Xms to the same value and set the PermSize and MaxPermSize to the same value. sun.reflect.inflationThreshold helps with the permgen. (http://jira.grails.org/browse/GRAILS-7878?focusedCommentId=66447&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-66447 in the Grails jira for the explanation)

btw. I filed this issue 10 mins ago: http://jira.grails.org/browse/GRAILS-9444 If it's interesting, please vote on the issue.

like image 63
Lari Hotari Avatar answered Oct 12 '22 23:10

Lari Hotari