Q:

Real time Protocol for a web-app in PHP

I'm working on a PHP application and I'm looking for some ideas for a real-time protocol that I can use for:
1) track users status and location within the application (this should be fast!!!)
2) chat system.
I'm looking for something like FMS and its "Shared Objects" where multiple users can subscribe to pieces of information. FMS is expensive and slow for what I need, I would need a widget loaded on each page, requesting a new connection to the FMS server, etc.... slow...
I need something fast, ope source would be perfect!. Something like what Google Waves uses for syncing shared documents.
Any suggestions?

A:

If you are willing to write this in PHP, I'd say you are looking at the wrong technology. There is 2 major problem with PHP and real-time.

When you run a PHP application, it is not persistant like Servlet with Java. It is hard and not really adapted to do communication between each connection. You have to use database storage, stream or file to send data between each instance. All of these methods are not very efficient.
It is using blocking I/O and this is where it hurts in term of performance and scalability.

You should look at non-blocking I/O technology for web server. They are all event-driven server which is something different from the PHP approach. Here are few example :

JBoss + Netty (Java) 
Node.js (Javascript) - Google Tech Talk about it
Twisted (Python)

