-
Notifications
You must be signed in to change notification settings - Fork 0
Server load
To make things clear: HTTP is not the ideal protocol for a Chat.
If you want to have a real chat server you should go for IRC or Jabber.
While not overcoming the limitations of a stateless protocol, the AJAX technology at least made it possible to implement a web chat that does not bring down the server.
This AJAX Chat is implemented to be as resource efficient as possible:
- The operations the server has to do are not complex, the queries to the database held simple
- Most of the work is done on client side: The language handling, the BBCode, Hyperlinks, Emoticons and Commands replacement is all done by JavaScript.
- Only updated data is sent to the clients to keep the traffic low.
Since version 0.7 of AJAX Chat it's possible to further increase performance by using a Flash (client-side) and Ruby (server-side) based socket connection to push updates from the server. => see Socket Server
To reduce server load and traffic without using a socket server you have some configuration options:
The time between update calls can be configured in js/config.js - the default is 2 seconds (2000 milliseconds):
// The time in ms between update calls to retrieve new chat messages: timerRate: 2000,
The chat upate can be delayed by setting the following option in js/config.js to false - this is set by default for the shoutbox:
// If set to false the chat update is delayed until the event defined in ajaxChat.setStartChatHandler(): startChatOnLoad: true,
The maximum users online can be configured in lib/config.php - the default is 100:
// Max users in chat (does not affect moderators or admins): $config['maxUsersLoggedIn'] = 100;
If you're writing a custom user authentication integration for AJAX Chat you should make sure you're following the lazy initialization rule.
Blueimp's AJAX Chat is released under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3