Another way to do this is to create a bridge from your Apache set up and Node, if you read through the guides about Node you will see that it is:
- Designed for high loads of networking
- Only spawns new threads when it need's to do blocking tasks such as I/O
- Extremely simple to use, based on Google V8 (Javascript Engine)
- Can handle thousands of concurrent connections
With the above in mind my road plan would be to create a database for your PHP Application, and create 2 connections to that,
- Connection used in the PHP Application
- Connection used within Node.
The Node side of things would be simple:
- Create a simple socket server (20~ lines)
- Create an array
- Listen for new connections, place the resource into the array.
- Attach an for the database
- When the event get's fired, pipe the new data to all the clients in the array.
All the clients will receive the data at pretty much the same time, this should be stable, it's extremely light weight solution as 1K Connections would use 1 process with a few I/O Threads, the ram used would be about 8~MB
Your first step's would be to set up node.js on your server, if you google around you will be able to find how to do that, a simple way under ubuntu is to do:
apt-get install nodejs
you should read the following resources:
for more technical assistance you should connect to the #node.js irc server on freenode.net, those guys will really help you out over there!
Hope this helps.