8.3.6 Controlling the number of concurrent executions using CTM
When you are using CTM, you can control the number of concurrent executions of a Stateless Session Bean.
CTM is a group of processes independent of the J2EE server. The number of concurrent executions is controlled when the invocation of the Stateless Session Bean between the EJB client and J2EE server is relayed, and the Stateless Session Bean is invoked. When using CTM, the number of concurrent executions will be controlled in each J2EE application.
- Organization of this subsection
(1) Controlling the number of concurrent executions of a Stateless Session Bean using CTM
By controlling the number of concurrent executions (flow control) with CTM, you can perform the following tuning:
-
If multiple J2EE applications with different loads for CPU and I/O processing are running on a J2EE server, you can set up the appropriate number of concurrent executions for each condition.
-
By managing pending queues (schedule queues) with CTM, you can maintain the number of pending requests below a fixed number, and you can report an exception to the client when requests are sent in excess of this fixed number.
-
If the load on a particular J2EE server is high, you can distribute the requests to other J2EE servers.
The following figure shows an example of controlling the number of concurrent executions of a Stateless Session Bean with CTM:
|
|
- Tip
-
CTM can control the number of concurrently executed threads on a host by controlling the invocation of Stateless Session Beans on J2EE servers running on the same host. Although this varies with the machine specifications of the application server machine, Hitachi recommends a configuration in which one CTM daemon and two to four J2EE servers are started for each machine.
Note that the number of concurrently executed threads can also be changed dynamically with CTM in a running CTM daemon.
For details about the CTM functionality to control the number of concurrent executions, and the procedure to dynamically change the number of concurrently executed threads with CTM in a running CTM daemon, see 3.4 Flow-volume control of requests in the uCosminexus Application Server Expansion Guide.
(2) Guidelines for proper usage with instance pooling of the EJB container
Hitachi recommends the control of the number of concurrent executions using CTM. Note that when you use CTM to control the number of concurrent executions, you can use the instance pooling functionality of the EJB container and controlling the number of concurrent executions at the same time.
The advantages of using CTM for controlling the number of concurrent executions, in addition to the use of the functionality of EJB container for controlling the number of concurrent executions are as follows:
-
When the number of concurrent executions reaches the upper limit in an EJB container, the requests can be distributed to another J2EE server.
-
If loading on a particular J2EE server is high even when the number of concurrent executions does not reach the upper limit, the requests can be distributed to another J2EE server.
-
By managing pending queues (schedule queues) with CTM, you can maintain the number of pending requests below a fixed number, and you can report an exception to the client when requests are received in excess of this fixed number.
- Tip
-
When you use CTM for controlling the number of concurrent executions along with the instance pooling functionality of the EJB container, you must set up the instance pooling count of Stateless Session Bean to a value higher than that of the number of concurrent executions of CTM.
For dynamically changing the number of concurrent executions of CTM during operation, you must set up no upper limit for the instance pooling count of the Stateless Session Bean. By default, no upper limit is setup. Do not change the default settings.