Escolar Documentos
Profissional Documentos
Cultura Documentos
Is Clustering Enough?
What Liferay High-Availability (HA) means: HA is more than just server clustering, though that is part of it. It is a configuration that: 1. is able to handle the expected number of concurrent users and subsequent traffic, and
HowDoYouKnowYoureDone?
Liferay clustering is not just pointing a load balancer to two (or more) Liferay nodes. You are not done. Why? Because there are certain application-level components that need to be either centrally managed or synchronized. Letsgothroughachecklist.
Web Server
Operating Locations System Apache 2.2.9 Debian 5.0 192.168.1.100 +mod_jk1.2.2 32bit 6
Checklist
1 /etc/apache2/sites-available/default
2 3 4 5 6 1 2 3 4 5 /etc/apache2/mods-enabled/jk.load /etc/apache2/ports.conf /etc/apache2/workers.properties /etc/hosts cat /proc/net/dev_mcast ifconfig -a | grep -i multicast cat /etc/hosts cat /etc/profile echo $JAVA_HOME echo $PATH $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/portalext.properties $TOMCAT_HOME/conf/server.xml $TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml
Liferay Portal
1, 2
6 7
8 $TOMCAT_HOME/../data/jackrabbit/repository.xml 9 $TOMCAT_HOME/webapps/ROOT/WEBINF/classes/ehcache/hibernateclustered. xml 10 $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/ehcache/liferaymultivmclustered.xml 11 cat /proc/net/dev_mcast ifconfig -a | grep -i multicast 1 /etc/mysql/my.cnf
Database
MySQL 5.0.51
HowDoIKnowItsWorking?
A quick test:
1) 2) 3) 4) 5) Bring up the load balancer Bring up Node 1 Bring up Node 2 Open Browser 1 and go to Node 1 directly (i.e. http://192.168.1.101:8080) On Browser 1 go to page 1 (i.e. - http://192.168.1.101:8080/web/guest/home) logged in as Admin 6) Open Browser 2 (different browser session) and go to Node 2 directly (i.e. http://192.168.1.102:8080) 7) On Browser 2 go to page 1 (i.e. - http://192.168.1.102:8080/web/guest/home) logged in as Admin 8) In Browser 1 add a portlet to the page 9) Shut down Node 1 10)Go to Browser 2 and refresh the page (i.e. CTRL F5)
This is because this behavior demonstrates that not only the load balancer is redirected to the live node, but that cache replication is occurring between nodes.
Examples Of Tools
There are several tools to help you monitor Sun JVM performance including:
Visual VM (http://visualvm.dev.java.net)
This tool provides a centralized console for viewing Sun JVM performance information, including garbage collector activities.
JMX Console
This tool helps display various statistics like Liferays distributed cache performance, the performance of application server threads, JDBC connection pool usage, and etc.
AddthefollowingtoyouappserversJVMargumentstoenableJMX connections:
-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=5000 Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
Tools
[VisualVMsVisualGC]
Tools
Tools
Tools
Thread pool for incoming requests Database connection pool Pleaseseeyourapplicationserverorservletcontainers documentation on how to configure these
Garbage collection
Concurrent low pause collectors i.e. - UseParNewGC, UseConcMarkSweepGC, CMSParallelRemarkEnabled,
ParallelGCThreads, CMSCompactWhenClearAllSoftRefs, CMSInitiatingOccupancyFraction
Java heap
You may find the definitive list of Sun JVM options are located at: http://blogs.sun.com/watt/resource/jvm-options-list.html
For a very detailed reference on memory management in the Sun JVM, please see the Sun whitepaper, "Memory Management in the Java Hotspot Virtual Machine" at: http://java.sun.com/j2se/reference/whitepapers/memorymanagement_whitep aper.pdf
ItsDifficultToGetSpecific
Whatworksforonesystemdoesntforanother
You will need to load test
Identify bottlenecks Apply the appropriate remedy
Summary
Load balancing is not enough Liferay is a Java web application Similar clustering conventions as other apps Liferay-specific clustering configurations Quick test to ensure that clustering is on Performance tuning involves some methodology Find your bottlenecks, do not just guess Look at memory, CPU, and blocked threads
Questions?
More Information
For more information on Liferay cluster settings, please see the LiferayPortalAdministratorsGuideat: http://docs.liferay.com/portal/5.2/official/liferay-administrationguide.pdf
Liferay Training offers a Liferay System Administration course, where you can configure an actual Liferay cluster, hands-on from scratch. Please see: http://www.liferay.com/services/training/topics/systemadministrator-training
To inquire about Liferay performance tuning consultation : sales@liferay.com, 1-877-LIFERAY http://www.liferay.com/services/consulting