All good! As promised, the second part of the translation of the
Java EE article. The first part can be seen
here .
COVERED OPERATIONHopefully, you have not only now realized that the budget is equal to 0, and WebLogic has conquered you in general;) Until now, we have considered topics that are important in the initial stages, while studying application servers. Now let's look a little deeper into 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 Productivity IndicatorsDid you know that the Lamborghini Gallardo LP570-4 Superleggra 2011 release accelerates from 0 to 60 km / h in just 2.8 s, and the Dodge Viper Hennessey Venom GT does it in 2.9 s? I think the drivers Viper sooo boring to wait until their car accelerates to 60!

We will 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 idiot-super-fast.
Similarly, the developer will not choose the application server for the fact that it starts 0.2 seconds faster, or even for half a second - the impressions will not change. Therefore, we will evaluate the servers based on the full experience gained by the developers in this section. First, the applications we use in performance tests are time tested: Spring PetClinic, in 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 app weighs no more than 20MB. Jenkins needs no introduction, a very popular CI framework, which many people enjoy using. The web application takes up a little less than 55MB, contains a spring framework and many web artifacts.
Test configurationAll tests were conducted on the same MacBook Air laptop. Features: 8GB RAM (1600 MHz DDR3), 2GHz Intel Core i7 CPU. HDD itself is 512 GB SSD, OSX 10.8.2. Used JRE:
Start / restart speedLet's start with the startup and restart speeds. We are testing an empty server, a server with a PetClinic application deployed and a server with a Jenkins application installed. And here are the results:

** note - all results are shown in seconds **
You may notice that the Liberty Profile and TomCat servers are twice as fast as the GlassFish servers and (surprisingly) Jetty. But all the results are more or less within acceptable values. When we start the server with the application, everything becomes more interesting: the Liberty Profile continues to hold a low value, and the time required for other servers increases dramatically. By the highlighted values, you can understand that Liberty Profile always runs 2-4 times faster than competitors.

If you compare each value with the best in the category, the Liberty Profile wins a clear victory, and Jetty and GlassFish unexpectedly disappoint. JBoss tries to hold positions, but launching the jenkins application shows a bad result - 11-15 seconds slower than the Liberty Profile.
Time on the patchLet's look at the deployment speed in seconds, using the examples of petclinic and jenkins applications on each of the servers.

You can see the 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 the Liberty Profile do that other servers fail to do? Even more precisely, what the Liberty Profile does not do ... It is worth looking at the time of application initialization in order to better understand this.
Application Initialization
Most of the servers show decent time, while the Liberty Profile shows a lazy initialization model. It is noticeable that at the first use a lot of efforts to launch / deploy are directed to later stages.

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

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

JBoss values ​​do not look critical with jenkins, and Liberty Profile is something to strive for. Tomcat - the winner of this category, eclipsed its competitors in almost all tasks.
Functionality and compliance with open standardsJettyJetty itself, for the most part, is a container and therefore it lacks many of the components necessary for the operation of more serious applications. But for such purposes there is a Jetty distribution called “Hightide”. Distribution for Jetty 9 yet, but you can use
Hightide for Jetty 8 . Jetty Hightide includes JNDI, JMX, annotations and JEE integrations. Even with all these cool features, Hightide weighs only 24MB. Jetty can also be embedded in a web application. This creates a running web application, which is largely due to the size of the Jetty codebase.
Rating:

Cause: Includes WebSockets, Jetty Continuations, Servlet 3.1 specification (almost finished), but almost nothing besides that.
TomcatTomcat 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 that performs all the integration work and provides “a full Apache stack aimed at certifying the Java EE 6 Web Profile in which Tomcat is in the lead”. 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), support for Bean Validation, CDI, EJB, JPA, JSF and JTA is worth noting. The 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 EJBs to Security. Any resource provided by Tomcat, say from context.xml, can be found by any managed component of the system. Cool! As in Jetty, Tomcat functionality is rather poor to meet the requirements of the Web Profile, but it is sufficient to meet the usual web specifications. You can choose the elements to add yourself, for example, OpenEJB or Open JBA, but it is not necessary to be limited to them.
Rating:

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

Reason: Improves Web Profile using tested Open Source components. Great!
JbossJBoss AS7 is fully compatible with EE6, and we mean Full Profile: EJB, CDI, JPA, JSF, Jax-RS, Bean validation, and so on. It supports OSGI 4.2, and in the future, 4.3. 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 gracefully. 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 a lack of support for EJB and CDI. But there is support for OSGi applications, in case this is your favorite technology.
However, already in the beta version of Liberty Profile 2013, support has been expanded to include EJB, CDI, WebSevices and, interestingly, product extensions, which allows users to create their own “functionality” in the server.xml file.
Rating:

Reason: Support Web Profile, OSGi, the ability to add your own functionality.
GlassfishLightweight section for comparison for GlassFish - the holder of the reference implementation of Java EE. 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, and so on. In addition, there is support for OSGi.
Rating:

Reason: Full support for JEE and OSGi. Cool!
Administration and Management / UIJettyPerhaps the biggest drawback is the lack of a management console, which you could get used to using other servers, such as Tomcat (Tomcat Manager) or JBoss AS. Therefore, managing large product environments may be too complicated, but certainly not when you use tools like
LiveRebel !
Rating:

Reason: Management is possible only with the help of scripts / direct xml changes.
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 nice feature that allows access to different roles for different levels of administration). The manager app is nothing special, just a basic set of actions: from deploying and modifying the application to specifying the properties of the OS and JVM.
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. It can customize data sources, web servers, OSGi, JVM parameters, JPA with transactions and more. Large selection and high speed of the console. If JBoss did not succeed in applying the changes made to the web console during the restart, it will display a message notifying you so that you won’t wonder why nothing has changed.
Rating:

Reason: High administration quality, information on reboot / restart, you need to configure users before use, flexible configuration of functionality, modern.
Liberty ProfileA little disappointing. The Liberty Profile does not have an administrative console for updating the server configuration, installing applications, etc., so you will 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.
Rating:

Cause: Limited support for poor technical previews, inappropriate for the browser UI format, the Eclipse tool interface is much better, but requires the use of Eclipse, which is bad for remote servers.
GlassfishGlassFish offers two ways to manage a server or cluster of servers: the asadmin utility or the web version of the administrative console, which is available by default at port 4848 and is a simple and friendly tool for making server changes. To change the HTTP port value, you need to 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 great and industrial, but its modular architecture allows you to make almost all the changes without restarting! We have saved the new value of the HTTP port and now it works. You can create different configurations and apply them to different servers or clusters. A very DevOps-directed way, in my opinion.
Rating:

Reason: A clean administrative console, without undue complexity, flexible configuration of functionality, perhaps a bit outdated, but not enough to reduce the score.
Cost $$$ / LicenseAll the servers in question are free to use in the development environment. Therefore, it should not be surprising that the cost is not just the initial cost in dollars. You need to remember about the support of the supplier and / or the community in cases when something goes wrong, the time and effort spent on infrastructure, including improving the functionality on the application server, testing and future updates. Below is a look at the cost of each server (minimum prices are taken with the minimum settings):

$$$ - these servers charge for use in production, but this is not the thing that you buy at the supermarket, so their pricing structure can cause a headache. The price guide was added where it was possible, but for those who still have questions about the environment, we added links with product prices, instead of writing misleading numbers.
JettyJetty 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 might be useful. Jetty 9 (as well as 7 and 8) has a dual license Apache License 2.0 and Eclipse Public License 1.0. It is free for commercial use and is distributed under the terms of any license, except as specified in the NOTICE file.
Rating:

Reason: The license is excellent and free! What more can you ask for!
JbossJBoss AS is an open-source product licensed under the LGPL, so it can be used in development and production. And due to its full EE6 profile, many things will work better than homemade library soup to support the EE stack. And if you prefer even more stable releases and availability of 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 ProfileAt IBM, everything has been packed for a long time, sent and tested, so maintenance is minimal. And if you buy and decide to deploy in production, you will always have the opportunity to contact support if something goes wrong. After reading the license from the beginning to the end, during the installation, twice, you will learn that there is no license to use the Liberty Profile for amateur development. It will not be possible to launch the application server for a personal project, because the Liberty Profile license does not allow it: o (However, this should not affect much, because in this review we look at everything from a developer’s point of view.
Rating:

Reason: The license is not flexible enough for hobby use outside of non-commercial development, but is suitable for developers, free for these purposes.
GlassFish (Open Source Edition)GlassFish Open Source Edition has a CDDL license, that is, it is free to use in development and production. A CDDL license gives you more freedom than GPL and BSD-based licenses, which means using GlassFish safely and in serious projects. If you want more support and faster bug fixes, you can upgrade to the Oracle GlassFish Server, which has better management tools. GlassFish has full implementation of JEE, 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 absolutely free!

THE END
As always, we are waiting for comments, questions here or on our
Open House .