1
votes

I need to increase the performance of a Liferay 6.2 portal running in a vm with 6GB ram. Increasing the Xmx and Xms above 3GB does not help.

So I stumbled upon this here paragraph from the Liferay User-Guide:

Note that there is a law of diminishing returns on memory, especially with 64 bit systems. These systems allow you to create very large JVMs, but the larger the JVM, the more time it takes for garbage collection to take place. For this reason, you probably won’t want to create JVMs of more than 2 GB in size. To take advantage of higher amounts of memory on a single system, run multiple JVMs of Liferay instead.

Now, how would I run multiple JVMs of Liferay? I mean I could easily run two tomcats on differents ports (like 8080 and 8082), but I guess those two instances would have to be linked somehow?

Scenario:

  • Liferay 6.2 EE
  • Tomcat 7
  • Very limited amount of concurrent users (5 max.)
  • One site, with one page and one custom portlet (+ LR login portlet) running on it
  • Very limited amount of data (last dump of my portlet's tables was 30MB)
  • No ext, no hook. Simple JSF portlet which does nothing but crud operations.
  • Oracle 11g database (running on the same machine for now)

(I know this is not the scenario for a portal, but the client wants it and is rather resistant to advice)

Loading the page takes up to 45 seconds before the user can log in. I can't give you the specs of the vm (Hyper-V running CentOS), but it won't be something amazing (read low budget).

Thanks, ~fabi

1
I think I found something promising (pen): liferay.com/de/community/wiki/-/wiki/Main/…FeinesFabi
Main problem will be that this is only helpful when we want to increase performance for concurrent users.FeinesFabi
Why do you think that memory is the cause of your portal slowness? did you monitor GC activity? is the 6Gb heap being fully used?Dror Bereznitsky

1 Answers

1
votes

I need to reorder my statements - sorry if this messes up story flow.

First and foremost, on a system with a single page and 5 users, you won't gain anything when you setup a cluster. With an answering time of 45 seconds, you have a severe problem in another place, not where you currently think. As of the information you give, one can only guess - but even that won't be a good guess - where those problems are. They're certainly not requiring a second instance. And I'll get that overly specific statement in the docs corrected.

This ends the answer to your original question, the underlying and assumed problem. Just in case you - or anybody else - really needs a cluster in future and wants to set it up, I'm leaving the rest of my answer here. It does not apply to your situation.


You'll have to measure it yourself if the blanket claim of 2G max holds for you. There are some portals that are memory bound, some are CPU bound, some are I/O or database-bound. You will have to check for yourself what limits the performance of your particular application. You might want to check Liferay's Performance Whitepaper (available on customer portal, as you seem to be an EE subscriber) and determine the nature of your application, and what kind of performance you can expect.

In case your portal is CPU-bound, two portals on the same VM won't help at all. You should rather take a look at the actual bottleneck and fix that. An answering time of 45 seconds - unless under very high load - points to a problem that I can't imagind to be solved with a cluster.

For the documentation of setting up a cluster, you might want to check the instructions in the User's Guide or available material on the new beta documentation site https://dev.liferay.com

Also, in a few days (I'm in the mid of postproduction) I will publish a Radio Liferay episode on Application Performance Monitoring, and in future possibly a series of episodes on this topic (planned) - it's currently number 3 in the queue - probably episode 44.

Also, clustering is a (almost full day) topic in System Administration Training. Lastly, as you mention EE, there is a clustering plugin for EE, optimizing the cluster communication that's going on. But be aware that you might need two EE subscriptions to run two instances in a cluster. I'm mentioning this here for completeness, not because I think that this plugin will help in your case.

After I have written all of this, I see that you are running Oracle on the same machine as Liferay - with this configuration another instance of Liferay on the same machine will definitely not help if you stick with 6G RAM. In fact, the reason for your bad performance might be the utilization of virtual memory: As soon as your server pages out memory to disk, you're toast. Note that either the VM guest or even the VM host might be the one doing the paging. You're a huge stack of toast if both are swapping memory at the same time.