Agileload Jboss Performance Tuning Whitepaper
Agileload Jboss Performance Tuning Whitepaper
Agileload Jboss Performance Tuning Whitepaper
Table of Contents
Introduction and Background Information.............. 2
Performance Priorities... 2
Principles of Performance Tuning....... 3
JBoss EAP Performance Tuning.. 6
Results of a Sample Application .................... 8
Conclusion10
@Copyright www.agileload.com
Introduction and
Background Information
IT architects should
be aware of certain
principles and best
practices to achieve
better performance
with JBoss EAP.
Performance Priorities
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.
User experience need not be the primary reason for performance tuning. A
well performing solution must normally use fewer software and hardware
resources. If performance tuning is done appropriately, companies can
optimize their hardware investments. This may involve using fewer systems
overall, buying modestly sized new systems or using existing systems for a
long period of time.
As far as software is concerned, a well performing solution might use fewer
software licenses or CPU counts irrespective of the type of software being
used in enterprises. So cost reduction in software packages may save
significant money over time.
@Copyright www.agileload.com
@Copyright www.agileload.com
The workload
profile of your
application may
depend on the
specifics of your
business, but you
must always pay
attention to peak
workload periods.
@Copyright www.agileload.com
and maximum call time, concurrent calls and the call-time standard
deviation. The JBoss EAP Admin Console can display all such information.
Many third party performance management products are also available
from Red Hat partners that help in providing the information related to
application performance.
In some cases, if the tool does not provide the required information then
you can have your own instrumentation by using a framework such as
JBoss AOP. This framework is equipped with all features that help you to
see all the runtime events. Your decision to write your own instrumentation
actually depends on the application, your skills and the significance of the
performance characteristics to overall success of an application.
4. Understanding where your application spends time
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.
@Copyright www.agileload.com
Connection pooling
Thread pooling
Object pools
Logging
Caching
1. Connection Pooling
If you wish to maximize the throughput on modern hardware then
connection pooling is the most important area to consider.
While connecting to a data source, JBoss EAP has to allocate and deallocate 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. So pooling data source
connections is much more efficient than allocating resources.
The activities to be performed include:
To determine the proper sizing, you can always monitor your connection
usage. A pool that is too small can throttle the application. The connection
pool utilization could be monitored from EAP JMX console or JBoss ON.
2. Thread Pooling
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.
@Copyright www.agileload.com
Removing connectors
If you can make sure that a particular connector is not necessary for your
application then you may remove it. For instance, applications normally use
httpd thread pool or the mod_jk thread pool. You can just consider any one
connector and remove the other.
Monitoring thread pools
By using the admin console of JBoss EAP, you can monitor the thread
pools. For each pool, the console displays the total number of active
threads and the size of the queue. You can also define and adjust
persistent thread pools by using EAP console as well as JBoss ON.
3. Object Pools
By using the
admin console of
JBoss EAP, you
can monitor the
thread pools. For
each pool, the
console displays
the total number
of active threads
and the size of the
queue.
Object pool settings denote the total number of object instances. Two types
of pools could be defined for EJB. They are ThreadLocalPool and
StrictMaxPool.
4. Logging
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. While promoting
your application to production, you have to consider the following changes:
@Copyright www.agileload.com
5. Caching
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.
In order to evaluate the performance results with JBoss EAP tuning, let us
consider a sample application. Here the sample application is an EJB
application along with a couple of servlets for user interface, a stateless
and a stateful bean for business logic, a message driven bean for
processing asynchronously and few entities for persistence.
Initially, for non optimized tests, we use default JBoss EAP configuration
(i.e. thread pool of 64 and default heap of 1.3 GB).
Later, for optimized test, let us adjust the heap size to 3.7 GB with large
page memory and the thread pool is increased to 150 along with database
connection pool at 150.
The results for both the scenarios are illustrated as follows:
Here we measure the scalability by using mean transactions per second
(TPS). The first test was conducted with default and non optimized
configuration as shown in the first graph below:
The second test was conducted with optimized configuration as discussed
above. This is shown in the second graph.
On comparing the two graphs, we can notice dramatic changes. The first
test scaled up to 90 virtual users and achieved above 75,000 peak TPS. But
with optimized JBoss EAP configuration, we almost doubled the number of
virtual users. We also doubled the peak number of transactions at above
140,000 TPS.
@Copyright www.agileload.com
@Copyright www.agileload.com
Conclusion
JBoss Cache is an
intrinsic component
of JBoss EAP.
Your application
can utilize it to
cache anything you
like.
@Copyright www.agileload.com
10