10 Tips to Deliver Outstanding Liferay v7 Performance

While the words “Digital Transformation” can mean many things, in the case of Liferay, we regularly see how organizations have transformed and enriched online journeys and experiences for their customers and employees by unlocking rich data, information, and applications hidden deep within their IT department.

This feat should not be understated because, as Forrester points out, the challenge of integrating numerous and complex back-end systems and data sources poses a real challenge, and a real threat, to project success.


As a long-standing Liferay Technology Partner we wanted to share the knowledge we’ve gained from the many customers that deploy Dynatrace Application Monitoring into their Liferay environments.

The Dynatrace FastPack for Liferay, along with screenshots and installation instructions used for this blog are available for free from the Dynatrace APM Community and have been updated to work with Liferay version 7.

If you’d like to download the free 30-day trial and check out the performance of your own Liferay application, you can download it here: Personal License

Tip 1: Liferay Overview

There are many aspects to Liferay, so to make performance and problem identification easy we created this high-level overview dashboard providing insight into key Liferay services like Blogs, Media Gallery, and Search. Context is also important. Besides viewing the health of page performance, the overview dashboard provides a window into key metrics that may be impacting page performance. These include site load, database activity, thread usage and Ehcache metrics.  Additionally, the Layer Breakdown provides a view into which classes are consuming the most time, while the Agent Breakdown highlights how much time and, more importantly, what kind of time – CPU, Database, Sync, Wait & Suspension – is being consumed in each tier.  By starting at the Liferay Overview, teams can quickly ascertain the nature of the problem at hand and proceed to diagnosing the problem while involving only the teams responsible for the problem, instead of pulling everybody together for an unnecessary war room.

All the dashboard widgets are interactive. For more details you can drill down in context to determine what’s causing the problem.


Tip 2: Understand your Portlet Pages

Most of the Portlets use the Liferay MVC framework as their implementation.  Transactions then split on the significant portlet parameter which was used to form the portlet URL. Identifying these pages with a Business transaction is not only a key to providing alerting in the Overview dashboard, but a key to understanding the performance of the different page types in Liferay. Most portlets can be identified by either Action Processed, Resource Served or View Rendered.  For example, a Wiki page is not simply a Wiki Page. By identifying and monitoring portlets by Portlet Phase, a slow Wiki page can be identified to actually be a slow Wiki Action Processed Page. This narrows down the scope of an issue (“all wiki pages are slow” vs. “Wiki Action pages are slow”), and immediately provides teams with a targeted subset of data to analyze further for root-cause analysis.


Tip 3: Understand your CMS Pages

 A very large portion of pages served by Liferay will be served by the Liferay Content Management System (CMS). Saying that CMS pages are slow is about as useful as saying most people like pizza. Do they like New York pizza, Chicago deep dish pizza, California “pizza”, or specialty pizza? What kind of toppings, if any? Red sauce, white sauce, pesto? In a similar, but less delicious manner, CMS Pages can be Private Site pages, Private User pages or Public pages. Additionally, they may be impacted by specific individual portlets that are present on the page. Ultimately, then, when “pages are slow”, it’s important to know which specific pages are slow and to determine if it’s because of a specific portlet on the page or if it’s something broader, like a slow query or issues elsewhere in the code.

Dynatrace brings clarity to this by identifying and analyzing CMS pages along these groups. The CMS Page Overview provides details about performance, throughput and errors, across multiple dimensions. It even lets you know if there are any host or process health issues that may be contributing to the slowness.


When there’s a problem with specific pages, deeper analysis can be conducted in the CMS Page Performance Analysis dashboard. By selecting a specific page on the top left, users can analyze the page for fault domain, API hotspots, database hotspots, errors as well as identifying which specific portlets, in their corresponding phases, are on the page, and if they are contributing to latency.


Tip 4: What’s in your cache?

Liferay utilizes Ehcache to help deliver a fast user experience. As a general rule, if something can be cached, it should be. What is not good is ignoring your cache. All too often, just like using frameworks, the mistake is made of enabling caching without making sure it’s optimized, or even being leveraged. The Ehcache dashboard, complete with pre-defined threshold alerts, is designed to provide awareness of cache usage. Specifically, this dashboard monitors Cache Occupancy Rate in memory and In-Memory Hit percentage for the different Ehcache caches. If page performance slows down, it is very easy to determine if misconfigured Ehcache is contributing to that problem. After fine tuning the cache parameters, you can confirm, in Dynatrace, if the caching is behaving better, and if performance has improved as a result.


Tip 5: Monitor the hosts & processes

Not every problem is related to code. In fact, many problems are simply a result of a poorly-tuned JVM. And, even with the most finely-tuned code and JVM a host will always have a limit. The two host/process related dashboards in the Fastpack provide a view of the health of these components. Common causes of latency in a Liferay system include GC pauses and misconfigured thread pools. The Liferay Process Performance dashboard monitors process CPU health, heap/GC utilization, the impact of GC on response times, and JVM/Liferay Thread pools. These provide great insight into whether or not threads and memory need tuning.


The Liferay System Monitor dashboard adds the context of host performance metrics like host CPU, host memory, disk I/O, and network I/O along with page performance and visit load. Sometimes a problem is as simple as a full disk because somebody misconfigured log cleanup. With an eye on page and visit load, it’s simple to determine if the server/process is simply overloaded with traffic, or if there’s a bigger problem with low load.


Tip 6: Liferay Database Performance

In almost any application, database performance still ranks as one of the top performance problems. The teams at Liferay see the same thing in their customer engagements as well. Three of the most common problems on the database side are the N+1 query, slow queries and JDBC pool usage. The Liferay Database Performance Dashboard shines a light on these and other database problems, including database host health.


Tip 7: Fix your worst performers

The key to a great user experience is not as simple as fixing what’s broken. The key is in having a consistent, quality user experience across the site. To truly provide a quality user experience, an old adage must be turned on its head: If it ain’t broke, fix it.  What we really mean is: take a look at the worst performing parts of your site. The Liferay Worst Performers provides a view of the slowest transactions and more. In the upper half, there’s a comparison of tier and package performance comparing the fastest 90th percentile with the slowest 10th percentile.  Overall this tells you where the latency coming from for the slowest activity on your site. The bottom half contains what we like to think of as an improvement checklist. It includes the slowest web requests, slowest user actions, slowest web services, slowest database queries, top client (browser/device) errors, and top application errors.  From these lists, the business owners can easily prioritize where to spend time on making improvements to the existing sites.


Tip 8: Send out a search party

Don’t leave your users stranded in a search. Liferay leverages external search engines to get the job done, and it’s important to monitor search’s health and performance. Liferay ships with Elastic search but can also be configured to use Solr. Index searcher determines which of these two engines is implemented, and delegates the search to the appropriate implementation for that search engine. Faceted search returns documents matching the search. The Liferay Fastpack exposes the time spent on each of these, and their impact on the actual individual search transactions. In addition, it’s important to monitor the overall performance of the Search portlet page by view rendered. By utilizing the Liferay Search Overview dashboards, you can make sure your users are not stranded without results.


Tip 9: Make your guests welcome

When you have guests over, it’s always important to provide them with both a warm welcome into your house and a fond farewell. This is why specific monitoring around Login and Logout is critical. Guests logging into your site should feel welcome entering and exiting your site. The Login Logout Overview dashboard appears similar to the Portlet Pages outlined in Tip 2. Login can be identified in Liferay two different ways: Login SSO and Login Non-SSO, which monitor the performance of the login and logout action. There are also two sign in portlet views for monitoring pages with this element. Sign in by view rendered and Sign in by action processed.


Tip 10: JavaScript and CSS files

Poor Web Page performance, usually caused by ignoring best practices, has plagued web sites for years, and continues to do so today. Dynatrace User Experience Management (UEM) provides deep insight into page performance as a whole, as well as by page components and third-party objects. However, no how matter how optimized your pages are, server-side issues can still create problems. The Dynatrace Liferay Fastpack provides two Liferay dashboards which you can use to monitor JS and CSS performance to ensure back-end latency does not ruin an otherwise quality user experience.  Server Side CSS and JavaScript Overview tracks the performance of these individual elements from the web server down through the stack. Client Side CSS & JavaScript tracks these same transactions all the way to the users’ browser.



Delivering an amazing, high-quality customer experience is more than an interface that looks and feels great. It’s about unleashing and utilizing the intrinsic value that’s locked up in back-end systems and data sources, to enrich and engage customer and employee online experience. Liferay provides the extensive framework to realize this engagement potential. However, to ensure the delivered customer experience is exceptional, it’s essential to have the depth and breadth of visibility across all facets of Liferay, custom code, and dependent applications.

Brian Wilson is a performance advocate with over 16 years of experience. After leaving the lucrative video production field, Brian began his IT journey as a QA analyst and quickly transitions to Performance. After years of leading the performance efforts at several well known companies,, Brian landed a cushy job as a Sales Engineer/Product Specialist at Dynatrace. Besides engaging in continuous learning by working with his clients, Brian gets to spend quality time leveling-up his skills and sharing his learning and passion for performance with others. In his spare time, Brian enjoys drumming, listening to music and spending time with his family. Brian also co-hosts a podcast with Andi Grabner. Listen on Spreaker or Pure Performance