You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ken Bowen <kb...@als.com> on 2008/06/26 21:57:18 UTC
NIO/Large-scale pushes to browsers/Jetty 6 Continuations
Hi All,
I'm working on a project which has developed a need to push data from
the server to browsers.
In the short term, the numbers of browsers will be moderate, but in
the long term, it appears
that we will need to scale up to very large numbers, so the 'one
thread per connection' issues
of Comet and Pushlets will become significant.
1) Clearly using NIO will help. My understanding is that NIO works ok
with Tomcat 6; is this correct?
Can it also be used in 5.5?
2) Is there any analogue of Jetty 6 Continuations available in
Tomcat? They sound like a good mechanism
for this problem. Does anyone on the list have any experience with
them?
More generally, does anyone have experience with a solution to our
problem (large-scale pushes from server to browser)?
Thanks in advance,
Ken Bowen
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: NIO/Large-scale pushes to browsers/Jetty 6 Continuations
Posted by Ken Bowen <kb...@als.com>.
(A) Biggest issue: My (mis)understanding that comet sufferred from the
'one connection/one thread' problem.
I see from Kris Zyp's response on http://cometdaily.com/2007/12/10/comet-gazing-scaling/
that with the Tomcat
comet interface, this is decoupled, so that the number of connections
can can scale independently of the number of threads.
Are there any working examples of the Tomcat comet processor scaling
to 10's of 1,000s of connections?
(B) Zyp [http://cometdaily.com/2007/12/10/comet-gazing-scaling/] states
"... the difficulty of horizontally scaling...
implementing a publish/subscribe type Comet mechanism on Tomcat that
scales efficiently across multiple machines would require significant
effort to properly route and distribute messages effectively."
What is the status on this? Our target is to run in a cluster.
(C) Besides the chat pseudo-code at http://tomcat.apache.org/tomcat-6.0-doc/aio.html
, are there other available examples?
(D) The description at http://wiki.apache.org/tomcat/WhatIsComet
sounds very similar /in spirit/ to the implementation
of JMS over AJAX in activeMQ (http://activemq.apache.org/ajax.html)?
Any thoughts?
On Jun 26, 2008, at 5:33 PM, Filip Hanik - Dev Lists wrote:
> Ken Bowen wrote:
>> Hi All,
>>
>> I'm working on a project which has developed a need to push data
>> from the server to browsers.
>> In the short term, the numbers of browsers will be moderate, but in
>> the long term, it appears
>> that we will need to scale up to very large numbers, so the 'one
>> thread per connection' issues
>> of Comet and Pushlets will become significant.
>>
>> 1) Clearly using NIO will help. My understanding is that NIO works
>> ok with Tomcat 6; is this correct?
>> Can it also be used in 5.5?
> unfortunately not, and a backport is not on the horizon
>>
>> 2) Is there any analogue of Jetty 6 Continuations available in
>> Tomcat? They sound like a good mechanism
>> for this problem. Does anyone on the list have any experience with
>> them?
> Tomcat has a CometProcessor interface, which is a step further than
> continuations.
> Allows you to decouple the connection from the thread and writing to
> the response in an async manner
>>
>> More generally, does anyone have experience with a solution to our
>> problem (large-scale pushes from server to browser)?
> sure do, just let us know what questions you might have
>
> Filip
>>
>> Thanks in advance,
>> Ken Bowen
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
Re: NIO/Large-scale pushes to browsers/Jetty 6 Continuations
Posted by Jess Holle <je...@ptc.com>.
Oscar wrote:
> We used BlazeDS's publish/subscribe feature to implement server-side PUSH.
> However, we found it didn't work well with NIO, CPU wasn't stable, What's
> even worse, CPU will constanly be 99.9%.
> The system worked well with APR.
>
Is this just with Tomcat or did you investigate with something Grizzly
based as well?
I've always wondered whether NIO was the issue on various reports or
just Tomcat's implementation thereof [and find the notion of native
libraries for something that /should/ be a Java core competency irksome
-- but perhaps that's the current reality].
--
Jess Holle
Re: NIO/Large-scale pushes to browsers/Jetty 6 Continuations
Posted by Oscar <ro...@gmail.com>.
We used BlazeDS's publish/subscribe feature to implement server-side PUSH.
However, we found it didn't work well with NIO, CPU wasn't stable, What's
even worse, CPU will constanly be 99.9%.
The system worked well with APR.
We're looking into NIO-related code in tomcat's latest codebase.
Anybody know the future of tomcat's NIO?
We know there is an existing NIO framework(called MINA) in Apache, will
tomcat reuse it?
On Fri, Jun 27, 2008 at 5:33 AM, Filip Hanik - Dev Lists <de...@hanik.com>
wrote:
> Ken Bowen wrote:
>
>> Hi All,
>>
>> I'm working on a project which has developed a need to push data from the
>> server to browsers.
>> In the short term, the numbers of browsers will be moderate, but in the
>> long term, it appears
>> that we will need to scale up to very large numbers, so the 'one thread
>> per connection' issues
>> of Comet and Pushlets will become significant.
>>
>> 1) Clearly using NIO will help. My understanding is that NIO works ok
>> with Tomcat 6; is this correct?
>> Can it also be used in 5.5?
>>
> unfortunately not, and a backport is not on the horizon
>
>>
>> 2) Is there any analogue of Jetty 6 Continuations available in Tomcat?
>> They sound like a good mechanism
>> for this problem. Does anyone on the list have any experience with them?
>>
> Tomcat has a CometProcessor interface, which is a step further than
> continuations.
> Allows you to decouple the connection from the thread and writing to the
> response in an async manner
>
>>
>> More generally, does anyone have experience with a solution to our problem
>> (large-scale pushes from server to browser)?
>>
> sure do, just let us know what questions you might have
>
> Filip
>
>
>> Thanks in advance,
>> Ken Bowen
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: NIO/Large-scale pushes to browsers/Jetty 6 Continuations
Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Ken Bowen wrote:
> Hi All,
>
> I'm working on a project which has developed a need to push data from
> the server to browsers.
> In the short term, the numbers of browsers will be moderate, but in
> the long term, it appears
> that we will need to scale up to very large numbers, so the 'one
> thread per connection' issues
> of Comet and Pushlets will become significant.
>
> 1) Clearly using NIO will help. My understanding is that NIO works ok
> with Tomcat 6; is this correct?
> Can it also be used in 5.5?
unfortunately not, and a backport is not on the horizon
>
> 2) Is there any analogue of Jetty 6 Continuations available in
> Tomcat? They sound like a good mechanism
> for this problem. Does anyone on the list have any experience with them?
Tomcat has a CometProcessor interface, which is a step further than
continuations.
Allows you to decouple the connection from the thread and writing to the
response in an async manner
>
> More generally, does anyone have experience with a solution to our
> problem (large-scale pushes from server to browser)?
sure do, just let us know what questions you might have
Filip
>
> Thanks in advance,
> Ken Bowen
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: NIO/Large-scale pushes to browsers/Jetty 6 Continuations
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ken,
I don't know anything about the use of NIO or server-side push, but...
Ken Bowen wrote:
| 2) Is there any analogue of Jetty 6 Continuations available in Tomcat?
| They sound like a good mechanism
| for this problem. Does anyone on the list have any experience with them?
Rhino (Java-based javascript interpreter) has continuation support,
which might be useful for you, but perhaps only if you will be able to
figure out how to get javascript to drive your server-side logic ;)
http://wiki.apache.org/cocoon/RhinoWithContinuations
There's also javaflow (http://commons.apache.org/sandbox/javaflow/)
which doesn't look javascript-related at all. It is in the 'sandbox' at
the Apache commons, so it's probably not production-ready at this point.
http://commons.apache.org/sandbox/javaflow/
Interestingly enough, it looks like Jetty's earlier work will be
replaced by the servlet specification's (3.0, still under development)
suspendable requests. http://docs.codehaus.org/display/JETTY/Continuations
Hope those help,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkhkCLcACgkQ9CaO5/Lv0PBeowCeLxMw0YVq8JyxYEioTHWeZ5qo
ZMQAoKRKkzk87hB326PlBbbBgWnLPGSH
=lw4u
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org