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

Chat module (AJAX gui) performance improvement

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.8.2
    • Fix Version/s: None
    • Component/s: Chat
    • Labels:
    • Affected Branches:
      MOODLE_38_STABLE

      Description

      When core Moodle chat is used in "gui_ajax" mode, each open chat windows triggers Ajax update every 3 seconds:
      https://github.com/moodle/moodle/blob/MOODLE_38_STABLE/mod/chat/gui_ajax/index.php#L78

      This in turn causes mod/chat/chat_ajax.php script to update lastping field in chat_users table:
      https://github.com/moodle/moodle/blob/master/mod/chat/chat_ajax.php#L146

      This does not scale well - it will cause a lot of DB writes when many users use the chat activity. And the problem gets pretty serious on installations when chat is commonly used - as users will usually keep the window open & running in the background for a long time.

      I propose to check the current lastping time and not update it more often than (say) once every minute.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            tmuras Tomasz Muras
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: