5.2.1 Estimating the resources used by J2EE server

This subsection describes how to estimate the number of threads and file descriptors of the J2EE server process.

The calculation formula when EJB is described in Session Bean is as follows:

Reference note
The number of threads and file descriptors of SFO server are same as that of the J2EE server. Calculate the number of threads and file descriptors using calculation formula of J2EE server.
Organization of this subsection
(1) Number of threads
(2) Number of file descriptors
(3) Estimating number of threads of CORBA Naming Service (When invoking as in-process)

(1) Number of threads

The formula for calculating number of threads is as follows. The total of (a) and (b) is the number of threads used by J2EE server.

(a) Basic number of threads

The formula is as follows:

Legend:

The following figure shows the example estimation when CORBA Naming Service is started as in-process and Cosminexus HTTP Server is used.

Figure 5-1 Example estimation of the number of threads when Cosminexus HTTP Server is used

[Figure]

The following is an example of estimating the number of threads for using Cosminexus HTTP Server shown in the figure.

Formula for calculating the number of threads, when CORBA Naming Service is started as in-process and Cosminexus HTTP Server is used

Maximum-number-of-threads = 68+A+B+C+D+E+F+G+H+I+J+K+L+M+O+P+Q+R+S

The results calculated using the above formula and the contents that are set up are as follows:

Maximum-number-of-threads = 68+0+0+1+5+72+72+144+2+0+72+5+2+0+0+0+0+0+0=443

Table 5-28 Contents estimated for the number of threads when Cosminexus HTTP Server is used (Example)

Setup itemSet valueExplanation
A0Sets 0 because Entity Bean is not used.
B0Sets 0 because Message-driven Bean is not used.
C1A remote invocation is not performed. Also, if the EJB is invoked locally from a Web application, the threads are not generated for executing the EJBs.
D4+1Such as C, the EJB client-related value is 0.
E48+24--
F72Sets the value of webserver.connector.ajp13.max_threads, which is the maximum number of concurrent requests, if there is one request in one transaction.
G(48+24) [Figure]2--
H2--
I0Sets 0 because the global transaction is not used.
J72Sets the value of MaxClient in the case of a Web server (Linux).
K5Sets the minimum value because the simple Web server is not used.
L2--
M0Sets 0 because the application is not in the exploded archive format.
O0Sets 0 because the TP1 inbound adapter is not used.
P0Sets 0 because the asynchronous Session Bean is not used.
Q0Sets 0 because the asynchronous Session Bean is not used.
R0Sets 0 because the settings for receiving the response message using a dedicated thread are not specified.
S0Sets 0 because the settings for controlling the closing of connections are not specified.
(b) Number of threads used according to JavaVM option specifications

According to JavaVM option specifications, calculate the maximum number of threads using the following formula. Add A only when -XX:+UseParNewGC option is specified, and add B only when -XX:+HitachiUseExplicitMemory option is specified.

Maximum-number-of-threads = A + B

Legend:
  • A: Number of threads used by parallel copy garbage collection.
  • (Value specified in -XX:ParallelGCThreads option. When this option is not specified, the default value of -XX:ParallelGCThreads option based on the number of logical CPUs. Note that the value is determined by the number of logical CPUs that exist when starting the J2EE server. Hence, the number of threads does not change even if the number of logical CPUs changes after the server is started.)
  • B: Number of threads used by the explicit management heap functionality (The number of logical CPUs. However, this number is 8 when the number of logical processors is 8 or more. This number is determined by the number of logical CPUs that exist when starting the J2EE server. Hence, the number of threads does not change even if the number of logical CPUs changes after the server is started.)

For the JavaVM options, see the following sections in the uCosminexus Application Server Definition Reference Guide:

(2) Number of file descriptors

The formula for calculating number of file descriptors is as follows:

maximum-number-of-file-descriptors: (139+A+B[Figure]3+C+D+E[Figure]2+F+G+H+I+J[Figure]2+K+L) / 0.8

Legend:

(3) Estimating number of threads of CORBA Naming Service (When invoking as in-process)

This section describes the estimation of number of threads of CORBA Naming Service generated on J2EE server when invoking the CORBA Naming Service as in-process while invoking the J2EE server.

Estimate the number of threads of CORBA Naming Service as follows when invoking the CORBA Naming Service as in-process:

Total-number-of-threads = number-of-threads + worker-threads-generated-during-initialization

(a) Number of threads generated during initialization

The number of threads generated during initialization is 6, when the value of vbroker.agent.enableLocator key of usrconf.properties is true and 4, when the value is false. The vbroker.agent.enableLocator key is setup as true automatically when the CTM integration functionality is enabled (true is specified in ejbserver.ctm.enabled key)

(b) Number of worker threads

The number of worker threads is the total of number-of-requests-received-concurrently + 1 and number-of-connections-between-client-and-CORBA-Naming-Service[Figure] 2.

The keys related to worker threads are as follows:

These keys are specified as value of ejbserver.naming.exec.args key of usrconf.properties. For details on the keys, see the manuals Borland(R) Enterprise Server VisiBroker(R) Developers Guide and Borland(R) Enterprise Server VisiBroker(R) Programmers Reference.

The number of worker threads when maximum value is specified in the vbroker.se.iiop_tp.scm.iiop_tp.dispatcher.threadMax key is the total of maximum-value-specified-in-this-key and number-of-connections-between-client-and-CORBA-Naming-Service.

However, when minimum value of worker threads is specified in the vbroker.se.iiop_tp.scm.iiop_tp.dispatcher.threadMin key, and when the total number of worker threads is not within that minimum value, consider the number of worker threads equal to the minimum value.

When the maximum value is not specified, the worker threads increase in multiples. However, the worker threads lapse when they exceed the time specified in the vbroker.se.iiop_tp.scm.iiop_tp.dispatcher.threadMaxIdle key (Default value is 300 seconds) from the time they are idle, resulting in reduction in the number of threads with the reduction in load.

When the maximum value of number of worker threads is specified and when the number of threads is the same as the maximum number of worker threads, do not perform error handling for the requests received from this point of time but continue the process as follows:

When the worker thread being processed is NULL (Responded), the next request reception is processed.