|
The node.js people make it sound like nirvana, and they make spring-based
apps sound like a failure. Their pitch that they can handle 10k connections in a single thread sounds enticing: does Grails/Spring have anything like that? thanks, owen |
|
servelet async ?
I think connections are not handled by grails but containers...
On Tue, Nov 8, 2011 at 4:02 PM, owenjc <[hidden email]> wrote: The node.js people make it sound like nirvana, and they make spring-based |
|
In reply to this post by owenjc
See project Grizzly and NIO,
Grizzly is available in Glassfish.... http://grizzly.java.net/ Tomcat also supports non blocking IO. Via the NIO connector. http://people.apache.org/~fhanik/http.html On Tue, Nov 8, 2011 at 4:02 PM, owenjc <[hidden email]> wrote: The node.js people make it sound like nirvana, and they make spring-based |
|
In reply to this post by xmly
Yes!
On Tue, Nov 8, 2011 at 4:06 PM, Gavin Yue <[hidden email]> wrote: servelet async ? |
|
So is a Spring-Grails-NIO setup functionally equivalent to node.js as far as the type of scalability node.js is good at?
|
|
From a threading perspective, it really depends on what your threads are doing, but I'm sure if you look into Grizzly you will find plenty of benchmark data that could give you a good feeling for how they stack up.
On Tue, Nov 8, 2011 at 4:35 PM, owenjc <[hidden email]> wrote: So is a Spring-Grails-NIO setup functionally equivalent to node.js as far as |
|
Unless you are interacting directly with IO (sockets, files, etc) is the container that will handle non-blocking socket io. In my opinion Jetty and Grizzly are pretty good at this but I don't have metrics to compare those to NodeJS. If you are interested in coding yourself non-blocking IO look into Apache Mina, also I recommend "Fundamental Networking in Java" by Esmond Pitt.
To say that some "x" technology is a "Nirvana" and state that "spring-based apps sound like a failure" is immature and shortsighted.. consider that you can have spring-based applications in java, scala, groovy... etc.
Cheers and good luck.
On Tue, Nov 8, 2011 at 1:42 PM, Daniel Honig <[hidden email]> wrote: From a threading perspective, it really depends on what your threads are doing, but I'm sure if you look into Grizzly you will find plenty of benchmark data that could give you a good feeling for how they stack up. |
|
In reply to this post by owenjc
Check out Atmosphere yet? There is even a grails atmosphere plugin. I haven't personally used it yet, but sounds enticing.
Jordon On Nov 8, 2011, at 1:02 PM, owenjc wrote: > The node.js people make it sound like nirvana, and they make spring-based > apps sound like a failure. > > Their pitch that they can handle 10k connections in a single thread sounds > enticing: does Grails/Spring have anything like that? > > thanks, > owen > > -- > View this message in context: http://grails.1312388.n4.nabble.com/Can-Grails-do-non-blocking-IO-like-node-js-tp4017457p4017457.html > Sent from the Grails - user mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
That is Comet, not NIO...
On Tue, Nov 8, 2011 at 5:47 PM, Jordon Saardchit <[hidden email]> wrote: Check out Atmosphere yet? There is even a grails atmosphere plugin. I haven't personally used it yet, but sounds enticing. |
|
In reply to this post by owenjc
The big pitch of Node.js (that i can see) is the use of eventing, like in browser based javascript.
This is quite a nice model, but isn't the be all and end all. If your application is frequently blocking on IO (database, file, network), then an event based model could be very useful for you. I've built a few apps like this over the years, in plain spring and in grails and they've performed quite nicely in that role. I've quite happily had jetty running 50k concurrent long running connections with a minimal thread pool (20) and minimal resource use. I've tended to use jetty 6 continuations, or servlet 3 continuations which work in a very similar way. You can use Tomcats NIO for the same purpose, however I prefer the style of either the Jetty or Servlet 3 continuations. To do this you do have to construct the eventing system, however its pretty easy to do, and you can tie it into spring integration or camel with quite a small amount of effort to give you configurable routing of your messages/ events. In addition, you can only use tomcat NIO in grails development mode in grails 2 (see http://jira.grails.org/browse/GRAILS-7018) Lastly there's Atmosphere. (http://www.grails.org/plugin/atmosphere) This seems quite feature complete and seems to work well enough, but I haven't put a huge amount of time into it, so I can't recommend it. So, in summary, yes you can build an event based system if you want to in grails/ spring and it will perform very very well. Personally I don't recommend using websockets just yet. The spec is still incomplete and has plenty of bugs to be shaken out. Most desktop browsers currently have it disabled for now due to security concerns. That said, if you use atmosphere, your server code won't have to change if you so want to use it. Now, I realise that I've blended event and message based systems together here, but with a Grails app you aren't constrained to staying with the request model, or messaging, or being forced to have everything use events. You could build any of them, all even, without too much trouble. Have an event based API for your heavy/ long lived load with a messaging back end to pass work off to a bigger back end server but with a normal controller for serving the homepage. Whatever takes your fancy.. ;-) David. |
|
In reply to this post by xmly
Ok, more to the point, the atmosphere framework can leverage NIO from the container (if supported) on inbound http requests/threads. I made the assumption we were talking about NIO in the context of webapps ( due to the reference to grails/spring ). Jordon On Nov 8, 2011, at 2:50 PM, Gavin Yue wrote: That is Comet, not NIO... |
|
I think the tomcat NIO connector, Servlet Async and Comet(Atmosphere) are a little confusing here.
Could anyone explain the relationship between NIO connector and Async Servlet?
Thank you. On Tue, Nov 8, 2011 at 6:14 PM, Jordon Saardchit <[hidden email]> wrote:
|
|
As I known,mostly popular web containers have supported the NIO connector,such as tomcat,jetty etc.
The Servlet Async ,support by Servlet 3.0? Atmosphere is a framework integrate comet,websocket,and the comet interfaces are not standardization. Ford.
On Nov 9, 2011, at 9:56 AM, Gavin Yue wrote: Atmosphere |
|
Node.js should equal NIO connector + Async Servlet?
On Tue, Nov 8, 2011 at 9:14 PM, Ford Guo <[hidden email]> wrote:
|
|
In reply to this post by xmly
Well, after reviewing, its really called the Tomcat Advanced IO connector. This allows the use of javax non blocking IO in a web app within tomcat. This is good, as it allows you to detach the thread from a particular request. The continuation APIs (Jetty 6 or Servlet 3) do essentially the same thing, allow you to detach the current thread from the current request and leave the request dormant until you want to wake it up later. Both require the use of NIO underneath, but thats an implementation detail, you don't see that within the app. This is all lower level than the nodejs system. So, so very very roughly, NodeJS == Continuations + Event/ callback handler system. Grails, using the facilities of modern servlet containers, can do non blocking IO requests. It does work differently though, you have to put some work in to get the callback style of coding. There's another layer over the top that gives a quite different system design. David. |
|
In reply to this post by owenjc
Someone already mentioned the async support in Grails 2.0: http://www.grails.org/doc/2.0.x/guide/theWebLayer.html#asynchronousRequestProcessing A node.js like framework for the JVM is vert.x: https://github.com/purplefox/vert.x (vert.x used to be called node.x, it also supports Groovy) Others: https://github.com/groovypp/gretty https://github.com/bleedingwolf/Ratpack Lari 08.11.2011 23:02, owenjc wrote: > The node.js people make it sound like nirvana, and they make spring-based > apps sound like a failure. > > Their pitch that they can handle 10k connections in a single thread sounds > enticing: does Grails/Spring have anything like that? > > thanks, > owen > > -- > View this message in context: http://grails.1312388.n4.nabble.com/Can-Grails-do-non-blocking-IO-like-node-js-tp4017457p4017457.html > Sent from the Grails - user mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
To restate from above: node provides a solution to the C10k problem, using an event model. It is single-language front and back end, for simplicity. It is not finished, but the enthusiasm in it's community is monumental.
http://en.wikipedia.org/wiki/C10k_problem lists web servers which try to solve the 10k connections problem, including tornado and node http://deftserver.appspot.com/ has chart comparing deft to tornado and node This thread has some comparison between webbit-deft-vert.x http://stackoverflow.com/questions/7715911/differences-between-apache-deft-webbit-and-vert-x nginx - event based This is a great explanation of node from a java developer's point of view: http://weblogs.java.net/blog/robogeek/archive/2011/11/01/nodejs-exciting-web-development-platform-java-programmer-point-view-0 So vert.x is closest to being a jvm-based replacemnt for node.js, and is multilingual even though written in ruby? That said, I don't see how it could be used with grails. Deft seems perfect: execpt for the same hooking-into-grails part. The advantage I hear for node is javascript because of closures - but groovy would be a near-perfect way to have callbacks with closures in a jvm-based solution. So to my mind - this is a somewhat cursory examination compared especially to some of the sophisticated answers presented here - deft-grails could provide a scalable simple solution that includes both messagine (request-based) as well as event-driven dev models? I really like staying in a comfortable dev environment with my debugger, spring, eclipse (STS), and everything. But if I want to put out a quick app for mobile SXSW news/reviews it appears to be easiest/best to go with node.js at this point. Sure seems like we are around the corner from a brave new world though. |
|
Administrator
|
FWIW
vert.x is not written in Ruby, it is written in Java but has a Ruby DSL (as well as Groovy/Java APIs) Cheers On Wed, Nov 9, 2011 at 9:53 PM, owenjc <[hidden email]> wrote: > To restate from above: node provides a solution to the C10k problem, using an > event model. It is single-language front and back end, for simplicity. It is > not finished, but the enthusiasm in it's community is monumental. > > http://en.wikipedia.org/wiki/C10k_problem > lists web servers which try to solve the 10k connections problem, including > tornado and node > > http://deftserver.appspot.com/ > has chart comparing deft to tornado and node > > This thread has some comparison between webbit-deft-vert.x > http://stackoverflow.com/questions/7715911/differences-between-apache-deft-webbit-and-vert-x > > nginx - event based > > This is a great explanation of node from a java developer's point of view: > http://weblogs.java.net/blog/robogeek/archive/2011/11/01/nodejs-exciting-web-development-platform-java-programmer-point-view-0 > > So vert.x is closest to being a jvm-based replacemnt for node.js, and is > multilingual even though written in ruby? > > That said, I don't see how it could be used with grails. > > Deft seems perfect: execpt for the same hooking-into-grails part. > > The advantage I hear for node is javascript because of closures - but groovy > would be a near-perfect way to have callbacks with closures in a jvm-based > solution. > > So to my mind - this is a somewhat cursory examination compared especially > to some of the sophisticated answers presented here - deft-grails could > provide a scalable simple solution that includes both messagine > (request-based) as well as event-driven dev models? > > I really like staying in a comfortable dev environment with my debugger, > spring, eclipse (STS), and everything. > > But if I want to put out a quick app for mobile SXSW news/reviews it appears > to be easiest/best to go with node.js at this point. Sure seems like we are > around the corner from a brave new world though. > > -- > View this message in context: http://grails.1312388.n4.nabble.com/Can-Grails-do-non-blocking-IO-like-node-js-tp4017457p4021337.html > Sent from the Grails - user mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- Graeme Rocher Grails Project Lead SpringSource - A Division of VMware http://www.springsource.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
So there is a cometd grails plugin - but it appears to have been dormant for 6 months. There is a grails Atmosphere plugin that appears active ...
Is vert.x useful for grails? Available for different web/appservers? Cometd is implemented by various appserver vendors ... I am unclear what the compatibility is of Atmosphere. |
| Powered by Nabble | Edit this page |
