Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] What are Jetty 9s most performant APIs to use?

I am upgrading a Jetty 7 based embedded server to Jetty 9 (v 9.1.4 – 9.2.0
when released) in a same effort of upgrading to Java 8. I intend to optimize
it in the process to serve out famo.us type of JavaScript for 3D web-sites
(HTML5/CCS3/JS) and some SVG without any plug-ins at the client side (WebGL)
and of course dynamic data coming from backbone components such as
databases. This results in a mix of many short effort/waiting responses and
some longer. So I definitely go for a non-blocking approach.

While the Java 8 upgrade was quite easy I find myself for a difficult
decision when it comes to Jetty. In version 7 I used the NIO and selector
interfaces to get Asynchrony but these classes do no longer exist in Jetty
9. I have been digging in the new Jetty 9 docs, on this Nabble User and this
Dev board and have read the articles on Webtide on Jetty-9’s Iterating
Asynchronous Callbacks, on the performance benchmarks and looked into the
docs sample code as well as the benchmark Java code on GitHub.

I found on this board that migrating from Jetty 7 to 9 needs a lot of
rewriting (as others have asked the question before). But since I learned
about the many improvements in the assync interface of Jetty 9 I decided to
do the effort of rewriting a completely new Jetty 9 based embedded Assync
server with SSL/NPN/SPDY3/2/HTTP  (hopefully HTTP2.0 ready to add it later)
and Websock server and client using the Jetty classes/APIs that give me the
highest possible  performance. 

As a side note, congrats to all you guys that have put down that Jetty 9
performance. As gregw correctly points out and demonstrates with the graphs
in the benchmark article it makes no sense being able to accept a ridiculous
number of hits if you can’t server them out in a ‘workable’ response time to
affect the client side screen.

The help or advise I am looking for via this post is in finding the
components in Jetty 9 to use, or even better an example of a server frame,
that would be considered by the Jetty team as the one using the most
performant APIs/approach possible in Jetty 9. The benchmark code is fast
according the Webtide article but it states explicitly it doesn’t “EVEN” use
Jetty’s most performant APIs. Other assync related articles mention the
QueuedThreadPool, Jetty 9s IO Callbacks and Itterating Callbacks but the
examples where separated from a complete frame example showing their
relation to selected Server options, connectors and so making it difficult
to see/know if all this combines with it the SLL/SPDY/HTTP/Web Sock
connectors and where or how you activate/select this working mode.

I started working from the “Example 25.4. SpdyServer.java” example of the
Jetty 9 docs with static max thread pools, because after reading the
comments inside Jetty’s  ServerConnector class source code
http://download.eclipse.org/jetty/stable-9/xref/org/eclipse/jetty/server/ServerConnector.html
I thought that was all I needed. However gregw’s Webtide articles
demonstrated I was not using Jetty’s most performant API’s. As you guys did
all this effort to create this new Jetty 9 I might as well do the effort in
rewriting my code from scratch to get the best out of Jetty.

I would appreciate some pointers, help or advice to show me the way.

TIA




--
View this message in context: http://jetty.4.x6.nabble.com/What-are-Jetty-9s-most-performant-APIs-to-use-tp4962539.html
Sent from the Jetty Dev mailing list archive at Nabble.com.


Back to the top