Will an AJAX shoutbox with lots of users active in it kill the server?
I am upgrading my online game, and i am going to use and AJAX shoutbox, to show shouts instantly, by refreshing the display area each second.
I was wondering though, if the server is being called every second by possibly hundreds of people, and displaying 50 shouts, will it kill the server and get me removed from my hosting for taking up server resources?
is there a better way i can make an AJAX shoutbox, which doesnt fetch the 50 shouts each second?
Instead of checking with teh server every second (called polling) I prefer to have my AJAX connect, the CGI or PHP then stals for upto 30 seconds untill there is any text/chat to output, if there isn't it dies and the AJAX makes a new request.
This makes the updates quicker, no up-to-one seond lag, and cuts load dramaticly.
Youd probably do a lot better making a java applet to do something like that just to be on the safe side. Im not sure how that particular chat works but calling any page that much will put pressure on the server.
Its hard to explain. Its almost exactly the same as what you are doing, but when the server gets your AJAX Request, instead of returning "theres nothing new". It will wait untill there is something to return.