Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-73319

First login is slow for some users after being offline for a while




      The issue is quite similar to MDL-59226. However, ajax calls mentioned there are different to what has been found for this issue.

      A site where it's been reported has a big number of notifications and almost all of the notifications are related to a small number of admins (automatic notifications on new users, self enrolments etc).

      The issue is happening for admin users after a few hours of being offline. First /my/ call takes about 3 minutes to load the page, but all further pages including logout/login attempts - all work fine. Then, after a few hours of not working on the site the issue is re-ocurring.

      We could profile this and core_message\api::count_unread_conversations turned out to be the cause. See profiling graph attached.

      Having this SQL we could replicate the issue directly in db (MySQL 5.7). First query takes ~3 minutes, but then results seem to be cached and the query completes almost instantly.


        Issue Links



              Unassigned Unassigned
              mikhailgolenkov Misha Golenkov
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona), Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              1 Vote for this issue
              2 Start watching this issue