17.1.1 Viewpoints for performance tuning
Tune the performance of the J2EE application execution platform with the following viewpoints:
-
Optimizing the number of concurrent executions
-
Optimizing the method of invoking the Enterprise Bean
-
Optimizing the method of accessing the database
-
Setting the timeout
-
Optimizing the operation of the Web application
-
Optimizing the operation of CTM
-
Tuning of other items
These points are explained below:
- Organization of this subsection
(1) Optimizing the number of concurrent executions
The objective of optimizing the number of concurrent executions is to enhance the throughput of the system by multi-processing in order to maximize the CPU performance. In the following cases, however, only multi-processing may not enhance throughput; sometimes the throughput may even deteriorate:
-
Bottlenecks in I/O processing and lock processing
-
Maximum throughput has already been reached
-
Load exceeds the multiplicity when the CPU usage is already full
-
Pending queue size is inappropriate
-
Settings for maximum number of hierarchical executions is inappropriate
Performance tuning aims at optimizing the number of concurrent executions through proper tuning for the above points.
(2) Optimizing the method of invoking the Enterprise Bean
The objective of optimizing the method of invoking the Enterprise Bean is to restrict unnecessary network access by using the local invocation functionality of the local interface and the remote interface when invoking the components in the same J2EE application and the same J2EE server.
You can restrict the unnecessary network access caused by RMI-IIOP communication, by using the following functionality:
-
Use of local interface
-
Use of local invocation functionality of the remote interface
In addition, you can further enhance the processing performance by using pass by reference method of passing the argument and return value. Performance tuning aims at enhancing the processing performance by effectively using these functions depending on the features of the application and the system.
(3) Optimizing the database access method
The purpose of optimizing the database access method is to reduce the overheads during database access by generating in advance the connections and statements that are likely to need more time for processing.
Performance tuning enhances throughput by optimizing the database access by using the following functionality effectively:
-
Connection pooling
-
Statement pooling (pooling of PreparedStatement and CallableStatement)
(4) Setting the timeout
The purpose of setting the timeout is to detect a failure that may occur in the system and release the resources whenever required to avoid a delay in responding to the requests.
There are following types of timeout settings:
-
Timeout of Web front-end system
-
Timeout of back-end system
-
Timeout of transaction
-
Timeout of database
(5) Optimizing the Web application operations
The purpose of optimizing the Web application operations is to increase the processing speed by restricting unnecessary network access that results from the use of cache and determination of delivery method of contents, and enhance the system throughput with the help of load balancing.
Note that the items that can be tuned differ depending on whether you are integrating with a Web server in which a redirector module is embedded, or whether you are using an in-process HTTP server.
You can execute the following processes for connecting to the Web server:
-
Dividing processes in the Web application and static contents
-
Caching static contents
-
Dividing requests according to session information
You can execute the following processes when you use an in-process HTTP server:
-
Separating the deployment of static contents from Web applications
-
Caching static contents
(6) Optimizing the operation of CTM
The purpose of optimizing the operation of CTM is to improve the performance of the system by reducing the communication overhead through optimization of the communication interval between the processes used in CTM, and by promptly detecting and taking action when a trouble occurs. Moreover, by prioritizing the processing of requests by CTM, you can tune to execute quick processing of the important requests.
(7) Tuning other items
In addition to those explained above in points (1) to (6), application server has other items that can be tuned. These can be tuned whenever required.