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

Chat module (AJAX gui) performance improvement

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.8.2, 4.4
    • Chat
    • MOODLE_38_STABLE, MOODLE_404_STABLE

      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.

            Unassigned Unassigned
            tmuras Tomasz Muras
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.