View Full Version : StockListDemo (sync on different windows)
CitiMan
11-17-2006, 04:19 PM
Hi
I am investigating use of your product for potential deployment in my company. I set up the demo app on my local evaluation lightstreamer server and opened 2 windows to view the table updates. They seem out of sync, especially 'Exacktum Systems' row.
Why would this happen? Is it an issue with the server or the javascript vm not able to handle 2 'busy' browser windows in a timely fashion?
I am using IE 6, which takes up 10-20% cpu time when viewing the stock demo (is this normal?).
thanks for any help (hope it's not in the wrong place!)
Alessandro
11-20-2006, 10:28 AM
I set up the demo app on my local evaluation lightstreamer server and opened 2 windows to view the table updates. They seem out of sync, especially 'Exacktum Systems' row. Why would this happen? Is it an issue with the server or the javascript vm not able to handle 2 'busy' browser windows in a timely fashion?
That is the demonstration of a desired behavior, as explained in the launch page (http://www.lightstreamer.com/stockListDemo.htm):
if you open the same demo in different browser windows you will see slightly different values for the most updated stocks (e.g. "Ations Europe"). This behavior shows how the data resampling is done in real-time on a per-window basis (e.g. click on the stock names to open pop-up windows that display real-time streaming charts. Notice that the maximum update frequency set for the pop-up windows is greater than the frequency set for the main window. The data is resampled by Lightstreamer Server accordingly with the maximum frequency requested by each table. You can easily notice that if you open "Ations Europe").
So this behavior shows the dynamic data conflation operated by Lightstreamer Server on a client basis (due to frequency allocation, bandwidth allocation and congestion control). If neededm it is possibile to write applications that keep the data in sync.
I am using IE 6, which takes up 10-20% cpu time when viewing the stock demo (is this normal?).
On the Client side, only JavaScript code is executed. The CPU usage depends on three elements: the browser employed (e.g. Firefox is much more efficient than IE); the number of updates per second that are received; the way the updates are displayed (i.e. through what kind of HTML(AJAX widgets, with what graphical effect, etc.). On a 3 GHz Pentium 4, the standard StockList Demo (http://app.lightstreamer.com/StockListDemo/) can consume between 5% and 15% of the CPU. The same demo on the same machine with Firefox will consume much less CPU.
CitiMan
11-20-2006, 11:07 AM
Thanks for your response.
Re the update fequency issue, I have read the blurb on the launch page too but still do not understand fully. Ok the pop-up window frequency is different from the main window, so their displays can be different.
But can you offer a step-by-step explanation of why the same page in two separate windows on the same client will differ?
Also how difficult is it to implement an application that keeps data in sync, ie what does the workaround involve?
Alessandro
11-21-2006, 12:09 PM
But can you offer a step-by-step explanation of why the same page in two separate windows on the same client will differ?
1) Let's suppose that there are two Lightstreamer clients (e.g. two browsers connected to the same web application), both of which have subscribed to the MSFT symbol in order to receive real-time prices. They subscribed to that item requesting a maximum update frequency of 1 update/s.
2) Let's suppose that the data feed during some intense market activity generates 30 prices in a second for symbol MSFT.
3) The data needs to be resampled. Lightstreamer Server contains two stages of data filtering, that are fully customizable. The first stage is a pre-filter, that can be configured to lower the update frequency of the updates for all the push sessions. The second stage is a filter that works on a per-user basis. This second filter can resample the data based on many variables (maximum frequency, maximum bandwidth, network congestions, etc.). In the StockList Demo the pre-filter is not used and the second filter is configured with the same frequency for all the users. Why two different clients will see different samples? Because the histories of data sampling for the sessions are independent one another.
Example. I'll show only one of the several reasons for which the data will be different for each client.
The data series is the following:
- time 0.10 -> 7.25
- time 0.78 -> 7.60
- time 1.23 -> 8.45
- time 1.47 -> 9.25
Client A subscribes to that item with a max frequency of 1 update/sec. It subscribes at time 0.08 so it will receive: 7.25, 8.45.
Client B subscribes to that item with a max frequency of 1 update/sec. It subscribes at time 0.5 so it will receive: 7.60, 9.25.
Also how difficult is it to implement an application that keeps data in sync, ie what does the workaround involve?
As I mentioned, data filtering in Lightstreamer is complex feature that can be fully configured, in order to obtain any kind of behavior. You should decide exactly what behavior you expect. For example: you want that different clients see the exact same data at any time? To do this you can: pre-filter the data; or increase the buffer-size of the per-user filters. If you want that the same client displays the same item in different tables (or windows of the same application) keeping the dtaa in sync, then the client should subscribe to that item once and use the received updates to populate more cells in the screen.
CitiMan
11-21-2006, 12:14 PM
Great answers!
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.