I have written a really simple push script using php and jquery ajax. However, the way I had to write the php was a while script which loops continually until an update it sent and then it turns false, send out the message, and starts again.
Problem is the php while script is eating up the server. I put in a usleep of 100,000 which is .1 sec but still eating it up and the more people who use this the more of these scripts run. So, any ideas?
1. Find a way to make the while less cpu intensive.
2. Setup a socket server and have the ajax connect to it.
I was trying to just use jquery (ajax) on the front end and php on the back end. I got it working with out any problems; just the php script while doing the "while" loop is maxing out the cpu and if several are initiated it just keeps it max but does not really overload it per say.