Friday, November 29, 2013

Liferay performance tuning


        Below are the high level steps to tune the liferay server :  

Step 1 : Adjust the server's thread pool and JDBC connection pool

  1. Unfortunately, there's no magic number for this: it must be tuned based on usage. 
  2. By default, Liferay is configured for a maximum of 100 database connections. 
  3. For Tomcat, a good number is between 200 and 400 threads in the thread pool

Step 2 : Turn off unused servlet filters


      Liferay contains 17 servlet filters. Chances are, you don't need them all, so turn off the ones you aren't using! 

 Disable the unused fileter by simply make them false in portal-ext.propeties 

velocity.engine.resource.manager.cache.enabled=true
com.liferay.portal.servlet.filters.cache.CacheFilter=true
com.liferay.portal.servlet.filters.etag.ETagFilter=false
com.liferay.portal.servlet.filters.header.HeaderFilter=false
com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter=false
com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter=true
com.liferay.portal.servlet.filters.autologin.AutoLoginFilter=false
com.liferay.portal.servlet.filters.i18n.I18nFilter=false
com.liferay.portal.servlet.filters.monitoring.MonitoringFilter=false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter=false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter=false
com.liferay.portal.servlet.filters.sso.opensso.OpenSSOFilter=false
com.liferay.portal.servlet.filters.secure.SecureFilter=false
com.liferay.portal.sharepoint.SharepointFilter=false
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter=false
Step 3 :  Tune your JVM parameters

          Ex :
JAVA_OPTS="$JAVA_OPTS -XX:NewSize=700m 
-XX:MaxNewSize=700m -Xms2048m -Xmx2048m 
-XX:MaxPermSize=128m -XX:+UseParNewGC -XX:
+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled 
-XX:SurvivorRatio=20 -XX:ParallelGCThreads=8"
Step 4 : Optimize Counter Increment
  1. One of the ways Liferay is able to support so many databases is that it does not use any single database's method of determining sequences for primary keys. 
  2. Instead, Liferay includes its own counter utility which can be optimized. 
  3. The default value: counter.increment=100 will cause Liferay to go to the database to update the counter only once for every 100 primary keys it needs to create. 
  4. Each time the counter increments itself, it keeps track of the current set of available keys in an in-memory, cluster aware object. 
  5. You could set this to a higher number to reduce the number of database calls for primary keys within Liferay. 

      Apart from the above steps we have to follow some more cofigurations that I will discuess in other post.

Thankyou

No comments:

Post a Comment

Distributed Transactions

What is a distributed transaction?  Transactions that span over multiple physical systems or computers over the network, are simply termed D...