The right platform for Java EE applications: how z / OS + DB2 turned out to be 3 times faster than Linux + Oracle


    Currently, more and more enterprise applications are being developed using portable cross-platform technologies such as Java Enterprise Edition. The structure of this platform includes a set of software interfaces that allow developers to abstract from specific DBMSs and message queuing mechanisms. This allows you to deploy the application on virtually any platform, including the mainframe.

    There is a widespread perception among the IT community that mainframes are very reliable, but inferior in performance to conventional Intel-based solutions and the Linux operating system. In this article, we would like to share the results of testing the performance of the same banking payment system that runs onIBM zEnterprise EC12 , but in one case it uses Linux and Oracle DBMS , and in the other - the z / OS operating system and DB2 DBMS .

    What we tested

    The tested banking payment system is an application built on the Java EE 6 platform. EJB components are used to organize business logic. Interaction with the DBMS is carried out through JPA technology, while Hibernate acts as a provider. The application actively uses message queues, interacting with them through JMS technology. In both deployment options, WebSphere Application Server 8.5.5 Network Deployment was used as the application server, while the Service Integration Bus (SIBus) mechanism integrated in it was used to manage message queues.

    All processed payments can be divided into two types: urgent and non-urgent. Urgent payments are made immediately after they are read from the input queue. In the process of processing non-urgent payments, three consecutive phases can be distinguished. The first phase - the reception phase - payments are read from the input queue of the system and registered in the database. The second phase - the phase of multilateral netting - is performed in single-threaded mode. At this phase, all accepted non-urgent payments are posted, and the mutual obligations of the system participants are taken into account. Third phase - the notification phase- starts automatically after the completion of the second phase. At this phase, the formation and distribution of information messages (receipts) for all accounts involved in multilateral netting is carried out. Each phase represents one or several transactions that include a complex sequence of actions performed by the application server and DBMS.

    It is important to note that for the developers of this payment system, the main platform is the Linux operating system and Oracle DBMS. However, thanks to the use of JPA and Hibernate, it was possible to quickly migrate the application to DB2 z / OS by replacing the dialect used with org.hibernate.dialect.DB2390Dialect. There is an IBM Data Movement Tool utility for database migration.

    Linux + Oracle test bench description

    The architecture of the test bench follows the best practices in the Linux world. On the zEnterprise EC12 mainframe, the H89 model was allocated two logical partitions (LPARs), on one containing 10 central processing units (CPs) and 25 GB of RAM, a WebSphere Application Server with a payment system installed on it, and on the other containing 10 CP and 158 GB of RAM, - DBMS Oracle. Communication between the tested application and the DBMS was carried out using JDBC Type 4 technology.

    Used software versions:

    - SUSE Linux Enterprise Server 11 SP3;
    - WebSphere Application Server 8.5.5 Network Deployment;
    - Oracle DB 11gR2.

    Description of the z / OS + DB2 test bench

    The stand on the basis of the z / OS operating system was a single logical partition (LPAR) allocated on the zEnterprise EC12 mainframe, containing 32 GB of RAM and 10 central processors (CP) plus 10 processors used to run Java applications and DB2 DBMS (zIIP ) All the necessary software was deployed on this logical partition: DB2 DBMS and WebSphere Application Server for z / OS application server. The communication between the tested application and the DB2 DBMS was carried out using JDBC Type 2 technology by accessing the native DBMS client libraries without using network connections.

    Used software versions:
    - z / OS 2.1;
    - WebSphere Application Server 8.5.5 for z / OS;
    - DB2 z / OS v11.

    After preparing and setting up each test bench, a series of training tests and tuning of deployed applications were performed.

    Testing and Results

    The load profile during testing repeated the load profile of a really working system. 2 million non-urgent payments, combined in packages of 500, 1000 and 5000 payments, were input. These packets in the form of electronic messages were fed to the system input in a continuous stream (one packet in one message). In parallel, electronic messages containing urgent payments (one payment in one message) were sent to the system input. Before the tests, the required number of payment system participants and information on previous payments were downloaded to each database.

    During the tests, the following results were obtained:

    Guaranteed time for processing an urgent payment - the most important indicator of the level of service provision by a payment system - on installations with z / OS and DB2It turned out to be 3 times less than on installations with Linux and Oracle.

    How can we explain the results? It is worth noting the very concept of a monolithic system, implemented in z / OS, - performing many tasks on a single image of the operating system and the presence of optimized methods of interaction between them. In addition to the unique task scheduler, z / OS includes the so-called cross-memory services- a technology that allows you to transfer control from the address space of one subsystem directly to the address space of the other with just a few special processor commands, without resorting to the scheduler of the operating system. In other operating systems, the implementation of the Inter-Process Communication (IPC) stack takes hundreds, or even thousands, of machine instructions, including calls to the functions of the kernel of the operating system. It is through cross-memory services that WebSphere Application Server for z / OS interacts with the DB2 z / OS DBMS using JDBC Type 2.

    Since the payment system in question was initially developed without reference to a specific DBMS, the multiversion concurrency control (mvcc) mechanism used in the Oracle DBMS was not used by the application. At the same time, it is known that the implementation of mvcc in Oracle is not free; you have to pay for hardware resources for convenience. In the case of DB2, all of these resources were spent directly on doing useful work. It should be noted that the development of this DBMS is carried out in close cooperation with the System z processor development team, which ensures more efficient use of all platform features (not all System z processor capabilities are available on Linux).

    Attention should be paid to the execution time of multilateral netting without taking into account work with the DBMS, i.e. execution time of only the calculated part. On z / OS, this time was 25% less than on Linux. This is a good argument in spite of the belief among IT professionals that Java does not work well on z / OS and that this operating system should not be used to run Java applications.

    It is also interesting to measure the execution time of each stage of processing non-urgent payments:

    At each phase of installation on z / OS and the DBMS, DB2 wins by more than 3 times in time.

    Separately, stress tests of processing urgent payments submitted to the system in a continuous stream were conducted. The purpose of testing was to measure the maximum number of transactions per second processed by the payment system in the corresponding installation.

    When interpreting the results, it is important to take into account that each urgent payment has its own payment message, which passes through several queues during processing, each time generating new transactions in the DBMS. Thus, the number of transactions performed in the DBMS per second is several times larger than the table.


    The conducted load testing clearly showed that the use of the mainframe’s native operating system and DBMS as a platform for corporate applications not only guarantees the highest reliability of the solution (which no one usually argues with), but also provides record performance indicators. In our case, the performance gain was three times .

    Due to the fact that the test application is built on a portable Java EE platform, the migration procedure to the z / OS operating system was carried out as soon as possible. Also, in just one day, the data schema was migrated from Oracle DBMS to DB2 z / OS DBMS. At the same time, we note that the development team of the payment system did not have much experience working with mainframes, which did not prevent it from preparing and successfully testing with the help of the IBM Russian office.

    In conclusion, I would like to recommend that corporate software developers take a closer look at mainframes. Investing in training to work with the z / OS operating system and the DB2 DBMS will not be in vain, because you can offer your customers solutions on a reliable fault-tolerant and, as we were able to demonstrate, very fast platform.

    Also popular now: