Debate about a great Java application server with Tomcat, Jboss, GlassFish, Jetty, and Liberty Profile. Part two

Original author: Oleg Shelajev
  • Transfer
Good day to all! As promised, the second part of the translation of the article on Java EE . The first part can be seen here .

UNDERSTANDING OPERATION

We hope you not only now understand that the budget is 0, and WebLogic has conquered you in general;) So far, we have covered topics that were significant at the initial stages when studying application servers. Now, let's look a little deeper at each server to see if it meets the real tasks of the developer:

  • Real performance indicators;
  • Functionality and Compliance Open Standards;
  • Administration and Management / UI;
  • Cost $$$ / License.

Read on, soon we will determine which application server is the best of the best!

Real Performance Indicators

Did you know that the 2011 Lamborghini Gallardo LP570-4 Superleggra accelerates from 0 to 60 km / h in just 2.8 s, while the Dodge Viper Hennessey Venom GT does it in as much as 2.9 s? I think Viper drivers are so bored to wait until their car accelerates to 60!



Let's not find fault, 0.1 seconds will not change the world, and the average driver will not notice the difference. For all of them, they will accelerate idiotic-super-fast.

Similarly, the developer will not choose the application server because it starts 0.2 seconds faster, or even for half a second - the impressions of this will not change. Therefore, we will evaluate the servers based on the full experience gained by the developers in this section. First, the applications that we use in performance tests are time-tested: Spring PetClinic, on which we show the JRebel demo, and the Jenkins application.

PetClinic is a web application using Servlets, JSPs and a bunch of POJOs. There is also Hibernate, JPA, JDBC integration code, and HypersonicSQL DB. The application weighs no more than 20MB. Jenkins needs no introduction, a very popular CI framework that many people enjoy using. The web application takes up a little less than 55MB, contains a spring framework and many web artifacts.

Test configuration

All tests were carried out on the same MacBook Air laptop. Features: 8GB RAM (1600 MHz DDR3), 2GHz Intel Core i7 CPU. HDD itself - 512 GB SSD, OSX 10.8.2. JRE Used:



Startup / Restart Speed

Let's start with the startup and restart speed. We test an empty server, a server with a deployed PetClinic application, and a server with a Jenkins application installed. And here are the results:



** note - all results are shown in seconds **

You may notice that Liberty Profile and TomCat servers are twice as fast as GlassFish and (surprisingly) Jetty servers. But all the results are more or less within acceptable values. When we start the server with the application, everything becomes more interesting: Liberty Profile continues to keep a low value, and the time required by other servers increases dramatically. From the selected values, you can understand that the Liberty Profile always starts 2-4 times faster than its competitors.



If you compare each value with the best in the category, the Liberty Profile wins, and Jetty and GlassFish unexpectedly disappoint. JBoss is trying to maintain a position, but the launch of the jenkins application shows a poor result - 11-15 seconds slower than Liberty Profile.

Deployment time

Let's take a look at the deployment speed in seconds, using petclinic and jenkins application examples on each server.



You can see a striking difference between Liberty Profile and other servers, some of which it is 6 times ahead.



Again we see that Liberty Profile is ahead of its competitors, and JBoss again did not get along with the Jenkins application. Otherwise, the server values ​​are similar.

What does Liberty Profile do, what other servers fail? Even more precisely, what the Liberty Profile does not do ... It is worth taking a look at the initialization time of applications in order to better understand this.

Application initialization



Most servers show decent time, while Liberty Profile reveals a lazy initialization model. It is noticeable that during the first use a lot of launch / deployment efforts are directed to later stages.



On average, we see that JBoss and Tomcat show excellent values, Jetty and GlassFish are not far behind, and Liberty Profile strikes with unbearable initialization, which lasts 14.5 seconds longer than average! Aw! Obviously, our servers do different things at different times, so combine these metrics to see the full picture:



Here we see that the values ​​for the petclinic application, when viewed as a whole, are not much different. Tomcat, Glassfish and Jetty are comparable in time for the two applications, with a difference of only a few seconds, while Liberty Profile and JBoss spend twice as much time on the jenkins application. Note that the Liberty Profile takes 25 seconds to complete the tasks that Tomcat performs in 11-12 seconds.



JBoss values ​​don't look critical with jenkins, and the Liberty Profile has something to strive for. Tomcat is the winner of this category, outshining its competitors in almost all tasks.



Functionality and compliance with open standards

Jetty

Jetty itself, for the most part, is a container and therefore it lacks many of the components necessary for more serious applications. But for such purposes, there is a Jetty distribution called “Hightide”. There is no distribution for Jetty 9 yet, but you can use Hightide for Jetty 8 . Jetty Hightide includes JNDI, JMX, Annotations, and JEE Integrations. Despite all these cool features, the Hightide weighs only 24MB. Jetty can also be embedded in a web application. This creates an executable web application, which is largely possible due to the size of the Jetty code base.

Assessment:



Reason: Includes WebSockets, Jetty Continuations, Servlet 3.1 specification (almost finished), but almost nothing else.


Tomcat

Tomcat’s functionality is not rich, and this forces developers to create their own features based on Tomcat. But now there is a new hope in the form of the TomEE apache project, which does all the integration work and provides “a complete Apache stack aimed at certification of Java EE 6 Web Profile, in which Tomcat is the leader”. The last part is the essence - the project seeks to maintain the experience and performance of Tomcat at the highest level, providing additional functionality that many users would like to see in the original version.

Of the most important components of the TomEE Web Profile (35.9MB) it is worth noting support for Bean Validation, CDI, EJB, JPA, JSF and JTA. TomEE + version (55.2 MB) additionally includes support for Connector, JAX-RS, JAX-WS, JMS. These features use the basic Tomcat infrastructure, for example, servlets now have access to JPA and Transactions, and EJB to Security. Any resource provided by Tomcat, say, from context.xml, can be found by any managed component of the system. Cool! Like Jetty, Tomcat’s functionality is pretty meager to meet the requirements of the Web Profile, but it’s enough to meet the usual web specifications. You can select the added elements yourself, for example, OpenEJB or Open JBA, but it is not necessary to limit them only.

Rating:



Reason: Poor functionality, so most prefer to use Tomcat only as a base.

TomEE

Rating:


Reason: Enhances Web Profile with tested Open Source components. Wow!

JBoss

JBoss AS7 is fully compatible with EE6, and we mean Full Profile: EJB, CDI, JPA, JSF, Jax-RS, Bean validation, etc. It supports OSGI 4.2, and 4.3 in the future. In terms of Open Source compatibility, JBoss is fully compatible with Java EE. It's hard to add something about JAXB, EJB, CDI - in any case, everything will work elegantly. At the same time, it is compatible with OSGi version 4.2, which allows you to use the best of both worlds.

Rating:



Reason: Full EE6 profile, OSGi support. Cool!

Liberty Profile

Version 8.5 does not fully support Web Profile - there is not enough support for EJB and CDI. But there is support for OSGi applications, in case this is your favorite technology.
Nevertheless, already in the beta version of Liberty Profile 2013, support was expanded to include EJB, CDI, WebSevices and, interestingly, product extensions, which allows users to create their own “functionality” in the server.xml file.

Assessment:



Reason: Support for Web Profile, OSGi, the ability to add your own functionality.

Glassfish

An easy comparison section for GlassFish, the owner of the Java EE reference implementation. Thanks to the support of Open Source, like JBoss, it is fully compatible with the Java EE server, again, this includes the full profile: EJB, CDI, JPA, JSF, Jax-RS, Bean validation, etc. In addition, there is support for OSGi.

Rating:



Reason: Full support for JEE and OSGi. Cool!



Administration and Management /

Jetty UI

Perhaps the biggest drawback is the lack of a management console that you could get used to using other servers, such as Tomcat (Tomcat Manager) or JBoss AS. Therefore, managing large product environments can be too complicated, but certainly not when you use tools like LiveRebel !

Rating:



Reason: Control is only possible with scripts / direct xml change.

Tomcat



Tomcat offers an administration application called manager app. But first you need to configure the conf / tomcat-users.xml file to provide access to roles (a good feature that allows access to different roles for different levels of administration). There is nothing special in the manager app, just a basic set of actions: from deployment and application changes to specifying OS and JVM properties.

Rating:



Reason: Simple, limited functionality, 80s-style console, you need to configure xml to add a user before using the management console.

Jboss



The web console looks decent, especially when compared to the Tomcat application. In it you can configure data sources, web servers, OSGi, JVM parameters, JPA with transactions and much more. Large selection and high speed console. If JBoss was unable to apply the changes made to the web console when restarting, it will display a message informing you so that you won’t wonder why nothing has changed.

Evaluation:



Reason: High quality of administration, information on reboot / restart, users need to be configured before use, flexible configuration of functionality, modern.

Liberty Profile

A little disappointing. Liberty Profile does not have an administrative console for updating the server configuration, installing applications, etc., so you get stuck in the eclipse editor by updating server.xml.



There is a web application called Liberty Profile Admin UI Tech Preview available for beta download. At first glance, it has only extremely basic functionality, it looks and feels like a mobile application, which is not very suitable for browser access.

Evaluation:



Reason: Limited support in poor technical previews, inappropriate UI format for the browser, the Eclipse tool interface is much better, but requires the use of Eclipse, which is bad for remote servers.

Glassfish

GlassFish offers two ways to manage a server or server cluster: asadmin utility or the web version of the administrative console, which is available by default on port 4848 and is a simple and friendly tool for making server changes. To change the value of the HTTP port, you must update the network listener. GlassFish uses network listeners to connect to the outside world, including HTTP connections. The easiest way to change the HTTP port is through the administrative web console:



Wow, that was easy! The GlassFish server looks large and industrial, but its modular architecture allows you to make almost all changes without restarting! We saved the new HTTP port value and now it works. You can create different configurations and apply them to different servers or clusters. Very DevOps-directed way, in my opinion.

Assessment:



Reason: A clean administrative console, without undue complexity, flexible configuration of functionality, perhaps a little outdated, but not enough to lower the assessment.



Cost $$$ / License

All the servers in question are free to use in the development environment. Therefore, it should not be surprising that cost is not just the initial cost in dollars. You need to remember the support of the supplier and / or community in cases when something goes wrong, the time and effort spent on the infrastructure, including improving the functionality on the application server, testing and future updates. Below is a look at the cost of each server (the minimum prices are taken taking into account the minimum settings):



$$$ - These servers charge for use in production, but this is not the thing you buy at the supermarket, so their pricing structure can cause a headache. A price benchmark was added where it was possible, but for those who still have questions about the environment, we added product price links instead of writing misleading numbers.

Jetty

Jetty is completely weightless, so everything that you screw to it will be supported by your framework team. Hightide in Jetty 9 offers more features than it comes in handy. Jetty 9 (like 7 and 8) has a dual Apache License 2.0 and Eclipse Public License 1.0. It is free for commercial use and is subject to any license, except as indicated in the NOTICE file.

Rating:



Reason: The license is excellent and free! What more can you ask for!

Jboss

JBoss AS is an open-source product licensed under the LGPL, so it can be used in both development and production. And due to its full EE6 profile, many things will work better than homemade soup from libraries to support the EE stack. And if you prefer even more stable releases and support, you can choose EAP distribution. The cost of JBoss EAP depends on the number of CPUs per year.

Rating:



Reason: Free to develop, but official support is paid.

Liberty Profile

At IBM, everything has been packaged, shipped, and tested for a long time, so maintenance is minimal. And if you buy and decide to deploy to production, you will always have the opportunity to contact support if something goes wrong. After reading the license from beginning to end, during installation, twice, you will find out that there is no license that allows you to use Liberty Profile for amateur development. It will not be possible to start the application server for a personal project because the Liberty Profile license does not allow this: o (Nevertheless, this should not affect much, because in this review we look at everything from the developer's point of view.

Rating:



Reason: License not flexible enough for hobby use outside non-commercial development, but suitable for developers, free for this purpose.

GlassFish (Open Source Edition)

GlassFish Open Source Edition is licensed under the CDDL, meaning it is free to use in development and production. A CDDL license gives you more freedom than GPL and BSD based licenses, which means you can use GlassFish safely and in serious projects. If you want more support and faster bug fixes, you can upgrade to Oracle GlassFish Server, which has the best management tools. GlassFish has full JEE implementation and therefore does not require excessive maintenance, as is the case with Tomcat and Jetty.

Rating:



Reason: The free version has almost everything you need, with a friendly license and completely free!



THE END

As always, we are waiting for comments, questions here or on our Open Day.

Also popular now: