Wednesday, April 28, 2010

liferay performance tuning


Performance Improvement ways in liferay

a) Memory - garbage collection thru Admin interface

b) Parameters to JVM while starting tomcat
-Xms128m -Xmx1024m -XX:MaxPermSize=128m

c) DBCP instances - increase it in ROOT.xml

d) Properties file changes
last.modified.check=false
theme.css.fast.load=true
javascript.fast.load=true

e) Servlet Filters

Total of 15 filters. Disable the ones that are not required. eg.

CompressionFilter
StripFilter

Open web.xml and comment the entries for these filters.

Similarly for,

CASFilter
NtlmFilter
VirtualHostFilter

The fewer servlet filters you are running, the less processing power is needed.

f) Portlet

Edit the following files to disable certain portlets from getting deployed to the portal server.

portlet.xml
liferay-portlet.xml

Restart the server

g) Database design

Ensure all the search colums are indiced properly.
Do periodic house-keeping on the database indices.
Proper design of the database tables keeping in mind the normalization techniques.

h) Get the cache-ing enabled for database objects.

By default only the User_ table is cached. Cache other tables as well that will be frequenly accessed.

Refer to the place where you can do this setting.

i) Application Layer

Write your code in such a way that you make lesser database / hibernate calls.

Remember, every call to the persistence layer is going to take time. So be very careful using them. Never use persistence layer calls inside loops.

Write optimized queries when you put them in custom-sql files.

j) UI design

place fewer portlets on a portal page.

when you use images / flash objects make sure that they are very small.

If you write custom css / javascript compress them using YUI compressor so that they get downloaded to the browser pretty fast.

Replace Tinymce in the place of FCKEditor.

k) Setting logging mode to ERROR.