This is a discussion on A better way to handle real-time data? within the PHP Language forums, part of the PHP Programming Forums category; On Fri, 25 Jan 2008 09:25:11 -0700, Martin wrote: > I have a series of php scripts that ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Fri, 25 Jan 2008 09:25:11 -0700, Martin wrote:
> I have a series of php scripts that provide the user interface to an > industrial automation program. > > One of the scripts serves out a page which displays some data, some of > which is constantly changing. On that page, I have some AJAX code > running that frequently requests fresh data and displays it (frequently > means about once a second). > > When the php script that services the AJAX requests receives one, it > passes a request of its own over to the main process (via a socket) > which responds with some data which the script then sends out to the > browser page. > > This all works fine but I'm concerned about the load this exchange of > data places in the main process. I would suggest having the data collection process write out the data to an external repository such as a database (a MySQL server can handle a pretty massive load even on a relatively low-end machine) and then you can separate the display of the data completely from the data collection process. You then have real-time data, historical data and the ability to stream-line the data collection process for better performance. -- I told you this was going to happen. |