i am trying to making php ajax based chat system….and i have developed it successfully…i am using jquery load() with setInterval to reload chat every 1 second and it works fine on my localhost….but when i uploaded it on my hosting server it also works fine … but problem is that after few mintues of chat the server takes to much long gets heavy loaded so that my server goes and and site goes down…
my question is that, why it is happening so far…and what is the solution…should i use standard xmlhttprequest instead of load() or $.ajax() instead of load();
jQuery.load() and jQuery.ajax() are basically front-ends for XMLHttpRequest. If they add extra overload (which is possible) it would only affect the browser.
Are you sure your server can handle such load? One request per second means that one single user triggers a minimum of 3600 requests per hour of conversation and I presume each request involves at least a database lookup. Now, being a chat server you are expected to have many simultaneous users.
Things you can try: