Skip to content
Yannick Warnier edited this page Mar 17, 2020 · 2 revisions

(near) Real Time Communications

Some Chamilo features (like the chat) require the client (browser) and the server (web server) to be in relatively continuous communication.

This article is a description of those features and how to find their frequency and, with that, modify the impact they can have on a server. Because any process that does not depend on user action to call the server can have a dramatic effect on performance when multiplying the number of users connected simultaneously to your Chamilo portal.

Most of these features can be disabled through Chamilo configuration if they require a rapid intervention.

Global Chat

The global chat is a box that appears at the bottom-right of the page and that allows any user to discuss with other users on the platform, usually (by default) only with contacts in the social network.

This feature is enabled by default and can be disabled by the admin through a platform setting in the admin page of Chamilo, by looking for "chat".

You might detect an excess in use of the global chat by looking at your web server's access log and seeing a lot of lines including GET /main/inc/ajax/chat.ajax.php?action=chatheartbeat

The default frequency of refresh is once every 4s, and it is defined in main/inc/lib/javascript/chat/js/chat.js by the variable minChatHeartbeat in the first section of the script. The refresh frequency is adaptative, and if no message ever gets to you, it will extend exponentially up to 33s, as defined by the maxChatHeartbeat variable.

Course chat

The course chat appears as one of the tools in a course.

If the tool itself can be disabled for all teachers and students by the admin through the tools section of the platform settings (in the admin page), it is enabled by default and is particularly difficult to track and to tamper with in a time of overload crisis.

You might detect an excess in use of the course chat by looking at your web server's access log and seeing a lot of lines including GET /main/inc/ajax/course_chat.ajax.php?cidReq=

The default frequency of refresh is once every 4s since Chamilo 1.11.12, but this frequency was wrong in all previous versions of Chamilo 1.11, as one rewrite of the course chat tool in 2016 made the refresh lower than 1s. As such, if you want to apply a quick patch to a previous version of 1.11 to reduce the load, you should look for this change f19aa74bee79ca5d82387ae693ed0d1bef0d5c6f and apply it to your portal.

It should be noted that, while the file on the server might have changed, users still in a group chat will not receive that update until they close or refresh the chat window. You can force that by shutting down the web server for 30 seconds or so, as the chat will try to update, then receive an error, then abandon the process.

Videochat

In 1.11 versions previous to 1.11.8, Chamilo included a videochat option, but it has been removed due to security flaws in - and lack of maintenance of - the webRTC library.

Clone this wiki locally