Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-120006

Performace issues with segments due to excesive Elasticsearch queries

    Details

    • What problem did the customer find?:
      The customer configured 75 user segments and they detected throughput issues in their testing before the go-live.
    • What do you think is the root cause? (if known):
      Hide
      Lack of cache system when querying Elasticsearch, we are retrieving same data again and again.
      There were no throughput testing during QA-testing so this problem wasn't detected at implementation time.
      Show
      Lack of cache system when querying Elasticsearch, we are retrieving same data again and again. There were no throughput testing during QA-testing so this problem wasn't detected at implementation time.
    • Proposed solution (if any):
      Add a cache to avoid continuously query Elasticsearch in the same way we do with the database or in the same way segmentation and personalization code does with Analytics cloud in AsahSegmentsEntryCache

      Description

      Segmentation defined segments causes performance issues due to excesive Elasticsearch queries.

      Every time a user clicks in a page, one Elasticsearch query is executed per each existing segment.

      So in case you have 100 segments, 100 Elasticsearch queries will be executed every time an user clicks in the Liferay interface.

      Some kind of cache should exist, retrieving data from Elasticsearch in case it is necessary.

      Steps to reproduce

      1. Go to control panel => server administration => log traces and activate DEBUG traces for category com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter
      2. Create a new site
      3. Add two pages (page1 and page2) and publish them
      4. Create 4 "email address" segments and configure them with:
        • email address contains domain-aa.com
        • email address contains domain-bb.com
        • email address contains domain-cc.com
        • email address contains domain-dd.com
      5. Open a new browser (for example a incognito window or change from chrome to firefox) and navigate to the page1:
        • Some Elasticsearch queries will be written to log file in a trace written by SearchSearchRequestExecutorImpl class.
      6. In the new browser move from page1 to page2 and vice-versa:
        • Expected behavior: There aren't new queries written to the log file
        • Wrong behavior: Some Elasticsearch queries generated by SearchSearchRequestExecutorImpl will be written to the log file, even there were no change in the user information

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cristina.gonzalez Cristina Gonzalez
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Sebastian Madaras
              Engineering Assignee:
              David Arques (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                21 weeks, 2 days ago

                  Packages

                  Version Package
                  Master