Hi there,
I'm creating a live chat script, something like Zopim, and for now the way i retrieve messages is using jQuery Ajax request loops every 'n' second, it works very good, but yeah, when we look at the apache access log we get tons of messages from the script, is this a bad thing ?
I know how to do long polling request, but i don't like this method, although it is effective, it is defective lol, sometimes it crashes apache, and it creates a process for every user that is using the chat, so i'm not going to use this method.
Another one is using services like Pusher.com for use HTML5 WebSockets, i'm testing this and i really like it, but if the Pusher website goes down the script itself doesn't work...
What do you guys recommend me to do, since this script is to be selled.
jQuery PHP MySQL Chat Doubts
Moderator: General Moderators
Re: jQuery PHP MySQL Chat Doubts
Well I would hazard a guess that the majority of SIMPLE chat services are going to be based via PHP, AJAX and MySQL.
Alternatives would be an actual chat 'server' which either deals through sockets or software that is designed as a chat protocol such as XMPP.
It really depends how much this intends on being used, because if it supposed to be used quite a considerable amount, then you may actually be better off using something that is dedicated rather than a script that gets called every second for every chat window that is running.
Admittedly, MySQL can handle that load, however depending on the resources your web server itself has, you could find it running under more load than it probably should be.
It really comes down to whether your underestimating or overestimating the usage of the system.
Alternatives would be an actual chat 'server' which either deals through sockets or software that is designed as a chat protocol such as XMPP.
It really depends how much this intends on being used, because if it supposed to be used quite a considerable amount, then you may actually be better off using something that is dedicated rather than a script that gets called every second for every chat window that is running.
Admittedly, MySQL can handle that load, however depending on the resources your web server itself has, you could find it running under more load than it probably should be.
It really comes down to whether your underestimating or overestimating the usage of the system.