High Availability and Performance - PART 1

download High Availability and Performance - PART 1

of 19

Transcript of High Availability and Performance - PART 1

  • 8/9/2019 High Availability and Performance - PART 1

    1/19

    1

    High Availability and PerformancePART 1

    James MinSenior Consultant and Sales Engineer

    Liferay LIVE 2010

  • 8/9/2019 High Availability and Performance - PART 1

    2/19

    Is Clustering Enough?What Liferay High Availability Means

    HA is more than just serverclustering, though that is part of it.It is a configuration that:

    1) is able to handle the expectednumber of concurrent users andsubsequent traffic, and

    2) reduces the single points offailure for a robust systemuptime.

  • 8/9/2019 High Availability and Performance - PART 1

    3/19

    Is Clustering Enough?Load Balancing?

    First, let's be clear on what "load balancing" is.

    Load balancing - a technique to distribute workloadacross resources. It is but one component in a

    high-availability cluster.

    volume of requests across multiple app servers,

    which may or may not be on physically separatehardware. Initially, this may seem sufficient, untilyou realize some of the components that theportal uses.

  • 8/9/2019 High Availability and Performance - PART 1

    4/19

    Liferay is a Java Web AppFamiliar Principles

    Many of the principles that apply to clustering anyother Java web application running on your Javaapplication server or Java servlet container apply

    here.We will be using familiar techniques such as load

    balancing and clustering at the server level, aswell as Liferay-specific configuration settings for

    application-level HA.

  • 8/9/2019 High Availability and Performance - PART 1

    5/19

    Typical High Availability Set UpHigh Level View

  • 8/9/2019 High Availability and Performance - PART 1

    6/19

    Sample Set UpsApache + mod_jk + Tomcat + Liferay

  • 8/9/2019 High Availability and Performance - PART 1

    7/19

    Sample Set UpsApache + mod_proxy + Tomcat + Liferay

  • 8/9/2019 High Availability and Performance - PART 1

    8/19

    Sample Set UpsApache + mod_proxy_balancer + Tomcat + Liferay

  • 8/9/2019 High Availability and Performance - PART 1

    9/19

    ChecklistLogical View

    Liferay clustering is not just pointing a loadbalancer to two (or more) Liferay nodes. You arenot done.

    Why? Because there are certain application-levelcomponents that need to be either centrallymanaged or synchronized.

  • 8/9/2019 High Availability and Performance - PART 1

    10/19

    ChecklistLogical View

    1. Load Balancer - it can be software (i.e. - Apache), or hardware (F5), orwhatever you wish, really. All it is doing is redirecting requests.

    2. Centralized Database - Hopefully, you have gotten off of HSQL and areusing a real DB server. This is a JBDC connection. It is abstracted fromLiferay's point of view. Any level of redundancy you have behind that JDBCconnection is up to you and your DBA. Just as an example, you may chooseto configure a MySQL cluster, or Oracle RAC, for DB high availability

    3. Ehcache - This is what Liferay uses out-of-the-box for it's Hibernate level 2cache. This needs to be configured to sync, else you will see inconsistencies

    depending on what node the load balancer redirects end users to. You arenot forced to use Ehcache, it is simply what it ships with. You could usesomething like Terracotta, for example. If you do not do this, you will mostdefinitely see inconsistencies depending on the node the end user is on, dueto stale caches.

  • 8/9/2019 High Availability and Performance - PART 1

    11/19

    ChecklistLogical View

    4. Lucene - This needs to be centralized. This can be done: a) via JDBC (can

    work, but there may be issues with speed and table locks), b) swapped out forsomething like SOLR (runs as a webapp in Tomcat), or c) starting with Liferay5.2 SP2 there is a clusterlink feature that can be turned on where each nodemaintains its own replicated cache. If you do not do this, you will seeinconsistencies with search and other indexed data that is returned from the DB.

    5. Document Library & Image Gallery - This needs to be centralized. This isbecause each node keeps the assets locally on the filesystem by default. Whilethe meta-data is in the DB, the files serve up faster this way (vs. BLOBS in aDB). So, you need to either a) point the content repository to be stored in theDB (can work but performance may suffer) via JCRHook in portal properties, or

    b) mount a path a shared storage (i.e. SAN or other file system storage) andconfigure each node to connect to this common place viaAdvancedFileSystemHook in portal properties. If you do not do this, the meta-data regarding your documents will be in the DB, but when you try to retrievethem, the node may or may not find the document there, physically.

  • 8/9/2019 High Availability and Performance - PART 1

    12/19

  • 8/9/2019 High Availability and Performance - PART 1

    13/19

  • 8/9/2019 High Availability and Performance - PART 1

    14/19

    A Quick TestAn easy way to see if Liferay clustering is turned on?

    Directory

    3rd Party CMS

    If Browser 2 refreshes and shows the addedportlet from Browser 1, Liferay clustering in mostlikely configured correctly. This is because this

    behavior demonstrates that not only the loadbalancer is redirected to the live node, but thatcache replication is occurring between nodes.

  • 8/9/2019 High Availability and Performance - PART 1

    15/19

    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

  • 8/9/2019 High Availability and Performance - PART 1

    16/19

    Next Part 2

    Continue discussion on the checklist

    Some options for these items

    How to approach performance tuning and what toexpect

    Questions from Part 1 and new questions

    Register at: http://liferay.com/web-events

  • 8/9/2019 High Availability and Performance - PART 1

    17/19

    Questions?

  • 8/9/2019 High Availability and Performance - PART 1

    18/19

    More InformationDocumentation and Training

    For more information on Liferay cluster settings, please see thehttp://docs.liferay.com/portal/5.2/official/liferay-administration-guide.pdf

    Liferay Training offers a Liferay System Administration course, whereyou can configure an actual Liferay cluster, hands-on from scratch.Please see:http://www.liferay.com/services/training/topics/system-administrator-training

  • 8/9/2019 High Availability and Performance - PART 1

    19/19

    Follow us on Twitter and Facebook!

    Twitter

    @Liferay

    Facebook

    www.facebook.com/liferay