Liferay slow due to multiple sites created to harness multi tenancy

thumbnail
Rajesh Chaurasia, modified 6 Years ago. Regular Member Posts: 183 Join Date: 8/18/11 Recent Posts
hi All,
How can improve the performance of Liferay which is slow due to multiple sites created to harness multi tenancy?
One way is using database shards ,are there other ways to improve performance
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Do not use the DB shards, they are no longer supported under 7.x and if you ever want to upgrade you'll be stuck trying to figure out how to undo the shards.

Performance can be improved by a number of different methods:

  • Add more nodes to the cluster.
  • Offload gzip and ssl to httpd.
  • Add external tools (ghostscript, imagemagick, xuggler and openoffice) to offload work.
  • General performance tuning (jvm tuning, disable filters not being used, etc.).
  • Add intermediate caching using Varnish or another appliance.
  • thumbnail
    Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
    David H Nebinger:

    Performance can be improved by a number of different methods:

    ...until here I agree, then I'll go in a different direction:

    1. Measure. Check what is the actual bottleneck in your installation
    2. Fix exactly that bottleneck
    3. Check if this fix improved performance enough so that you can move on
    4. If it doesn't improve performance enough: Continue at 1

    The techniques that David mentioned are good, but measuring will make sure that you don't introduce more complexity for 2% more performance as your first activity. Instead you might start with the 50% elephant in the room (numbers made up, of course)
    thumbnail
    David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
    The tunings I suggested are no-brainers and low hanging fruit, they can be done w/o measurement and provide a known result.

    But Olaf is right for that last mile; you shouldn't guess and apply tweaks w/o knowing if there is an actual need for improvement and what the change might cost in terms of development and maintenance (i.e. if you get only a 100 ms benefit from your change but you have to develop it and figure out how to maintain it against future Liferay releases, the cost/benefit ratio might be so skewed that the 100 ms is worse for you in the long run).
    thumbnail
    Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
    The interesting aspect of this: Your (David's) suggestions are good ones for generally tuning the performance, and none of them address the (IMHO probably incorrect) assumption made by the subject of this thread: "due to multiple sites...".
    I can't think of an aspect of multiple sites to cause performance problems, unless it's just so much active data that caches are constantly overflowing, but that could happen in a single site as well. So: I'm back at: Measure first, before introducing additional complexity.
    thumbnail
    David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
    I assumed that, because they are using multitenancy, that the biggest concern there is going to be concurrent users.

    If you expect 2k concurrent users on one site, your setup may be fine. But if that multiplies by the number of sites you have, well that's when multitenancy can be a concern.

    So my suggestions, while not backed by direct measurement initially, position your nodes to maximize concurrency.
    thumbnail
    Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
    ...that's still rather "due to too many concurrent users" than "due to multiple sites" ;)