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

The Notifications Portlet may cause a performace issue when a large number of users are signed in

    Details

      Description

      description: each signed in user pings the DB for updates to its notifications every 12 seconds. However, this process involves a synchronized method that will always wait for 2 seconds unless it is interrupted by an incoming notification. If there are many users and each request on the synchronized method takes 2 seconds, there will be many blocked threads that may cause the portal to hang.

      steps to reproduce:
      1) connect a portal to an IDE and add a logging breakpoint to com.liferay.portal.poller.SynchronousPollerChannelListener#getNotificationEvents to print out the time whenever the method is executed
      2) deploy the notifications portlet and notice that eventually the breakpoint will print out every 12 seconds
      3) create another user
      4) as the other user sign in with a different browser (leaving the first user signed in)
      5) notice that the method is pinged every 6 seconds or so.

      add more users who are signed in to different browsers and watch the logging messages.

      each request takes 2 seconds because of the following portal.properties:
      poller.notifications.timeout=1000
      poller.request.timeout=1000

      the thread is waiting for 1000ms to be interrupted and then it sleeps for 1000ms before querying the DB for the notification events

      UPDATE: the thread appears to never be interrupted because the listener is not registered to the channel for the user

        Attachments

        1. fix.jpg
          fix.jpg
          40 kB
        2. reproduce.jpg
          reproduce.jpg
          49 kB

          Issue Links

            Activity

              People

              Assignee:
              lu.liu Lu Liu
              Reporter:
              andrew.betts Andrew Betts
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 24 weeks, 5 days ago

                  Packages

                  Version Package
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M3