Before posing my question, I think that some background information is necessary. I am looking into methods to create a web-based chat system. Right now, my options are polling, or a comet system (long polling, long-lived connections, etc). I have found several comet solutions that look promising, but implementing them is no walk in the park. So far, ape-project.org looks to be the most promising comet solution.
The easier option to implement is the polling system. I was thinking that I would use javascript to request a php page, which would then run a while loop until new data is found. The while loop would expire after 30 seconds or so (or some arbitrary time to prevent "dead" connections from running if user leaves the site). If there is any data to "push" to the client, it would be sent, and the while loop would be ended. Immediately after the client receives and processes the newly received information, it would request the same page again, once again activating the while loop. This would go on until the user logs out.
My inquiry is this..
Just how intensive on the server is the polling method? I can't seem to find any good information regarding how apache would handle many concurrent while loops running in this manner. Does it use up threads on the server at a quick pace, greatly limiting the scalability of such an approach?