Wednesday, December 29, 2010

Tuning Eclipse Helios / Liferay 6 development environment

We are doing Liferay 6 / JSF + facelet / icefaces portlet development. Our eclipse development environment is far from friendly though. I have been testing many different options for the development of these portlets including the liferay ide plugins, various maven archetypes for generating these portlets, etc.

My goal is to get a seamless hot-deploy working within the eclipse environment to allow my development team to make a change, save and have the change automatically propagated to their local tomcat 6/ liferay 6 environment for easy testing and debugging.

I have configured my environment according to the instruction on the Liferay IDE documentation site.

I have been able to successfully launch the liferay 6 server via the eclipse servers perspective, but it is very slow and sporadic. Sometimes it will debug sometimes it will not and will timeout after 300ms. I removed all of the portlets from tomcat 6 which I am not using to speed the liferay/tomcat loading time. I have managed to get the startup down to 155 700ms, but that still seems extremely slow to me. I am going to attempt to get that down to something more in the range of 30 seconds if possible. This blog is a chronicle of my attempts and the results. No idea if any of this stuff will help, but even if not, hopefully it will save someone else from wasting time trying this stuff...

Test 1 - Tuning Eclipse settings. First thing I am going to do is optimize my Eclipse environment. This is a brand new install of Eclipse Helios, and I have yet to tune up any JVM settings or anything. I am not sure how the actual debugging is wired up, but I presume Eclipse launches Tomcat in its own container, then 'connects' to it via the debugger, so this should have little effect on the overall Liferay loading, but this needs to be done anyway, so I will try this first.

Changed the eclipse.ini as follows... startup now at 93665ms.

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:/java/jdk1.6.0_21/bin
-vmargs
-server
-Dosgi.requiredJavaVersion=1.6
-Xmn100m
-Xss1m
-XgcPrio:deterministic
-XpauseTarget:20
-XX:PermSize=400M
-XX:MaxPermSize=500M
-XX:CompileThreshold=10
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UnlockExperimentalVMOptions
-XX:+DoEscapeAnalysis
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
-XX:+AggressiveOpts
-Xms256m
-Xmx512m

Servlet Filters

Turned off servlet filters in the portlet-ext.properties file as follows:

com.liferay.portal.servlet.filters.cache.CacheFilter=false
com.liferay.portal.servlet.filters.audit.AuditFilter=false
com.liferay.portal.servlet.filters.sso.cas.CASFilter=false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter=false
com.liferay.portal.sharepoint.SharepointFilter=false
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter=false
com.liferay.portal.servlet.filters.sso.opersso.OpenSSOFilter=false