Performance was once regarded as one of the other features of an application. Now-a-days it is considered as an important characteristic of an application. Performance has a significant impact on the productivity of any enterprise.
Principles of Performance Tuning
JBoss EAP is an integrated Java Enterprise Edition application and service hosting platform. It actually enhances the Java standard and provides strong base for Java EE. JBoss EAP runs on multiple virtual machines and operating systems such as Windows, Linux and Unix and is compatible with many industry leading databases. JBoss EAP has to be performance tuned from the start for business critical production environments.
The basic components of JBoss EAP are shown in the following figure:
Understanding the performance requirements
The initial step in performance tuning is to evaluate the conditions under which it needs to perform. If your application is just a replacement for an existing one then your company already has significant experience with that software application. Precise metrics such as number of transactions per day, number of users and transaction load variations are quickly and effortlessly available.
Planning for peaks and not averages
One of the major mistakes developers make is to rely on averages. But averages are just not sufficient to make sure that your application performs extremely well during peak load periods. So, your primary goal should be to build application workload profile with special focus on peaks. For instance, many applications might witness daily peaks in the morning and afternoon with a valley during the middle of the day during lunch sessions.
Instrument your application
It would be better to instrument all applications in order to provide information for performance analysis. Business conditions such as workload curves and customer behaviors can alter over time. If your application has not been instrumented for performance, and if you run into trouble then it is very difficult to trace the existing problems.
Understanding where your application spends time
One important motive to instrument your application is to know where the time is being spent. JBoss EAP tools can help you to know the time spent across each application stack layer. With these tools, you can actually understand some part of the equation. For instance, if your application spends more time in the database, you should focus on the statistics of your database to resolve the issue.
Replicating the production environment
To understand the performance of your application in production, a test environment is essential to run the application. In some organizations test environments are exact replicas of the production environments. As developers need not worry about scalability issues, this is considered as an ideal approach.
JBoss EAP Performance Tuning
While connecting to a data source, JBoss EAP has to allocate and de-allocate the resources for every connection. But this is very expensive in terms of time and resources. Connection pooling can reduce the cost of data source connections by creating a pool of data source connections that are available to be shared by all applications.
Thread pooling is another area to be considered. Before deciding to size thread pools, you have to evaluate their usage and their impact on the performance of your application. Certain application attributes may decide which pools could be used and which ones could be estimated as bottlenecks. But this may vary from one application to the other.
Object pool settings denote the total number of object instances. Two types of pools could be defined for EJB. They are ThreadLocalPool and StrictMaxPool.
Developers can take advantage of logging in the application lifecycle development and testing. You need to ensure that logging provides useful and relevant information without troubling the throughput.
JBoss Cache is an intrinsic component of JBoss EAP. So your application can utilize it to cache anything you like. You can enhance the performance by caching EJB entities. Apart from JBoss Cache, you have prepared statement caching that could be set in the data source configuration. With minor changes, an application may experience substantial improvement in throughput.