Reputation: 2272
Is there any real difference to the performance when you use Netty and if you don't use it in an application with tens of thousand of connections?
Upvotes: 15
Views: 21876
Reputation: 25050
Twitter used Netty in its Search System:
Ref: Twitter Search is Now 3x Faster
Upvotes: 1
Reputation: 324
Actually using Tomcat NIO, you can get up to 16,000 concurrent connections; mind you thats CONCURRENT connections on one machine. This was tested against as a comparison vs Jetty which topped out at 4000 when they kept giving them more and more memory. (http://www.javalobby.org/java/forums/t92965.html)
And using a 'convention over config' framework like Grails with REST functionmality built in (or simple plugins like RestRPC), you can easily build API's, webhooks, etc in seconds.
I also have more control using Spring Security plugin as to who can access what api call via what IP or what role if I want.
Netty has limitations that the plethora of Grails plugins can expand far beyond using Tomcat NIO.
Upvotes: -1
Reputation: 106351
Netty is very fast, especially with many connections.
In my experience:
Upvotes: 3
Reputation: 14373
HTTP web app is not necessarily go to apache httpd and tomcat:
Upvotes: 6
Reputation: 8204
Not really, as Peter noted.
However, I've found that Netty also offers a very nice API for building a server. Although there is a bit of a learning curve to the API, it's well made and creating a new server can be trivial. It's also quite efficient code-wise, so you would have very little code, if you have a simple protocol and implementation.
This is ONLY if you are building a server for something other than HTTP. If you are talking about an HTTP web application, go with the tried an true. Apache for straight HTML pages, Tomcat if you need Servlets.
Upvotes: 12
Reputation: 533442
Not really, a good reason to use Netty is to improve the reliability of the connections and leave you to code what the connection does rather than worry about the details of everything which can go wrong. (Often only comes by finding out the hard way)
Netty may help you scale over 1K connections. However if you don't need so many connections you might find that simple code performs best.
Upvotes: 23