Friday, March 24th, 2006

Comet is here with LightStreamer?

Category: Comet, Java, JavaScript, Library, Showcase

Alex Russell coined the term Comet as a way to discuss a different interaction model to standard Ajax. It all sounds good, but how can we implement the server side piece? Should we use Twisted? Apache mods?

There is an Italian vendor that has been on this for ~5 years LightStreamer. They have servers that use the scalable Java NIO to linearly scale up with huge numbers of connections. The product also has interesting features such as controlling bandwidth to particular users.

LightStreamer offers the long-polling technique, and the iframe technique to implement Comet (Ajax Push).

LightStreamer Stocks

Posted by Dion Almaer at 10:41 am

4.1 rating from 65 votes


Comments feed TrackBack URI

Did anyone else notice that this stock demo isn’t even using Ajax (at first glance at least). If you fire up fiddler it looks like their stock demo is just a bunch of Javascript…

Comment by Brian — March 24, 2006

…sweet. I can’t wait to work on a project where we get to think about using this. Thanks for the great post.

Comment by Mark Holton — March 24, 2006

Wasn’t there talk of a free version of Lightstreamer being released – I remember reading it on a forum – can’t remember where.

Comment by Nutz — March 25, 2006

Theres also an approach to this using flash and liveconnect. Its called Stream and it works similarly but has some thought to the backend programmer. Current versions work with WSE/SOAP support following the microsoft service oriented architecture paradigm. for more info.

Comment by Kevin McArthur — March 25, 2006

This app crash my Firefox so kinda sucks.

Comment by JZA — March 26, 2006

If you want this functionality, Jetty 6 Servlet Container has it. It is called Continuation and is based on NOI.

Comment by Jetty fan boy — March 26, 2006

I dis-connected the internet, and their demo kept showing me new prices… that doesn’t smell right.

Comment by John — March 27, 2006

Didn’t find any prices on the LightStreamer page. Does anyone have this information?

Comment by Gabriel — March 27, 2006

Same here, demo appears to be just that, a demo, no actual Comet or streaming going on here. I also didn’t like the loading bar on the bottom which never completed. If it looks like this, great, but it still leaves room for Ajax to do it’s own thing. Comet does not appear to be a replacement for Ajax, nor has it said anything to that effect.

Comment by Moocats — March 27, 2006

All the online demos show actual streaming. The data is delivered in real-time by a server located in Italy. So it’s pretty impossible that new
prices are shown if you are disconnected from the Internet…

Comment by Alessandro Alinone — March 27, 2006

In IE it still continually adds memory (b/c of the IE memory leak). But I guess there’s no solution for that (refresh?).

Comment by Bronskrat — March 28, 2006

Just keep the demo open and after some hours you will see that an automatic garbage collection is performed and the memory is reset. The time after which the garbage collection occurs can be configured on the server.

Comment by Alessandro Alinone — March 29, 2006

I think a better example would be Marketmatch.

Comment by Shaun Guidolin — March 29, 2006

hi all,

i realized that there is performance downfall problem for ajax app if it counters large amount of users and frequent updates. i found from the lightstreamer documentation which stated that lightstreamer has bandwidth control machanism and i wondering, can it encounter the problem and provide an acceptable performance for large amount of user?

Comment by Ivor W. — March 31, 2006

Scalability is a fundamental feature for a Comet Server, since a large number of concurrent TCP connections has to handled.
Lightstreamer is based on a staged event driven architecture, built over Java NIO classes, that allows it to handle an arbitrary number of connections with a fixed pool of threads.
Just to give you an idea of performance, on a single Pentium 4 CPU – 2.4 GHz, Lightstreamer Server was able to sustain 10,000 concurrent streaming connections with an outbound frequency of 1 update/sec per client.

Comment by Alessandro Alinone — March 31, 2006

BTW we’ve had an Apache open source Comet server for well over a year…

which is SEDA based using a high performance message bus on the server side with Jetty 6 using NIO and server side continuations for efficient thread usage.

Comment by James Strachan — April 4, 2006

I love the new possibilities that this COMET technology will bring. Nonetheless, nothing survives the press of the ESCAPE button!

Try the live chart demo on both Firefox and IE. Pressing Escape will kill the connection, thus ends the life of COMET. I think untill this is solved (maybe a Javascript timer to detect connection — if current connection is closed then it will automatically reconnect and resume/create the session) then COMET won’t have that bulltet-proof used in application.

In my oppinion, a true PUSH technology will have to push the data as long as there is an Interet connection.

Comment by Alex Le — April 20, 2006

Alex Le,
Thank you for your feedback. Now all the Lightstreamer Demos have been made resilient to the ESCAPE button.


Comment by Alessandro Alinone — May 29, 2006

Excellent work, and we were testing your app and we have a couple comments:

1.- Memory leak at the browser level, and some of your demos are designed to run for a long period of time using JS code.

2.- And about the server scalabity the limitation will be about the simultaneous concurrent connections, every connection will be a socket and probably a thread in the server side, regarless of the frecuency. Our of curiosity how much in RAM that machine you refers it has?

Congratulations for the great work.

Comment by Jerry — August 22, 2006

Thank you very much.
I reply to your comments.
1- We have been doing a lot of work to avoid any JS memory leak in our code. But the JS engine of some browsers is intrinsically leaked (several bug reports exist, for both Firefox and IE). I think we have reached a good overall behavior. Please try to run some duration tests over our demos yourself.
2- Scalability is definitely a point of strength of Lightstreamer. The Server is based on an event-driven architecture an Java NIO classes, so that the classic “one-thread-per-connection” paradigm is avoided. Lightstreamer Server works with a fixed pool of threads, irrepspective of the number of concurrent connections. This means that on a single-CPU Pentium-based desktop box you can easily reach 10,000 concurrent streaming connections.

Comment by Alessandro Alinone — August 25, 2006

Moving forward, If we want to proceed to buy/test/deploy your app, seems like is mandatory to install all the server software under our domain (because the cross domain scripting problem) or create a IFRAME and render all the content from the lightstreamer app to that IFRAME. Have you had overcome those problems, if we want to embed your feed in any other webpage?

Comment by Alessandro — September 2, 2006

Alessandro, that’s not a problem, but browser’s feature.
Please take a look at this Mozilla’s document

Comment by Mone — November 17, 2006

Laser Eye Surgery

Laser Eye Surgery

Trackback by Laser Eye Surgery — November 28, 2006

Are there anyone know how lightstreamer deals with memory leak problem. I try to develop an application by using JavaScript to receive message from server which update rate is very high. I got a memory leak problem. Currently, I have 2 doubt that are tag of update come into iframe and DOM access. I am wondering that lightstreamer can deal with this problem. What technique does lightstreamer use? I use iframe in IE and XMLHttpRequest for FireFox.

Comment by Shin — October 17, 2007

Leave a comment

You must be logged in to post a comment.