I am developing a web application for a client that requires me to know the names of all users currently online. The entire application is built in php with jQuery used for the front end delivery. However, I found that I can setup an independent Node.js server that will be able to continuously monitor the users.
My original design had me including a query script in the top of every page that would check the db for updates. I upgraded that to a js that uses $.post() to get a response from a serving php page.
What I need to know is what sort of performance impact would using node.js have if I used it instead of the standard mysql access every time ?? Is it even possible? The application would have anywhere between 500 to a 1000 people online simultaneously so my client is stressing on performance.
Also if such a solution is feasible, any help regarding how I should go about implementing it would be very welcome.
You could potentially see huge performance gains by using Node.js for this. The list of online users could easily be kept in memory in Node.js and you wouldn't even need to hit the database at all.
As user list requests come in, you can add the requesting user to the user list data structure and then return the list. Keep a last-accessed time for each user. Run a function periodically (once every second) with setInterval to loop through the list and eliminate any users which haven't requested the list in awhile.
Since the list would be kept in the memory of the Node.js process, there would be no database accesses and requests would be processed extremely quickly.
You asking for numbers which is very hard to give because it depends on your system however, if you check the web for node.js benchmark you will find that node.js significantly outperform PHP or other web technologies in such cases.
I recommend to use socket.io module (you can find on their site http://socket.io/ many examples).
If your hosting support websockets then socket.io has amazing performance.
The only variable I don't know about is the performance with mySql since most of node.js developers work with nosql such as mongodb.