Liferay performance tuning beyond JVM settings
JVM tuning is where most Liferay performance work begins and, unfortunately, where a lot of it ends. Heap sizing and garbage collection matter, but they are one layer of a much taller stack. Once the JVM is sane, the biggest remaining gains almost always come from caching, the database, the front-end, and how the cluster is configured. Treating performance as a whole-system property is what separates a portal that scales from one that merely survives.
Get the JVM baseline right, then move on
A reasonable heap, a modern collector such as G1, and GC logging enabled is usually enough as a starting point. The goal is not a perfectly tuned JVM but one that is no longer the bottleneck, so you can measure everything above it. Endless GC fiddling has diminishing returns compared with the layers below.
Caching is where the real wins are
Liferay caches at several levels, and a misconfigured cache quietly undoes all your other work. The layers worth understanding:
- Entity and Hibernate cache: avoids re-reading the same rows; size it to your working set, not arbitrarily.
- Multi-VM cache (Clustered): in a cluster, ensure cache replication or invalidation is actually configured, or nodes serve stale data.
- Fragment and page cache: caches rendered output; the highest-leverage cache for read-heavy public pages.
- CDN and HTTP caching: push static and cacheable responses to the edge so they never reach the application server.
The database is the floor
No amount of application tuning beats a missing index. Most portals that feel slow under load are waiting on the database. Enable the slow query log, add indexes for the columns your custom queries filter on, and watch the connection pool: a pool that is too small serializes requests, while one that is too large overwhelms the database.
Front-end performance counts too
Server response time is only half of what the user feels. Bundling and minifying JavaScript and CSS, serving images in modern formats, and enabling HTTP compression often improve perceived performance more than any back-end change. The Network tab is the fastest way to see what the browser is actually waiting on.
Tune the whole system
Performance is a property of the entire stack, not a single setting. The teams that get it right measure end to end, fix the layer the evidence points to, and re-measure rather than reaching reflexively for JVM flags. Once the JVM is no longer the bottleneck, the database, caches, and front-end are where the meaningful gains live.