2.15.2 Parameters for controlling the number of concurrently executing threads
(1) Maximum number of concurrently executing threads
From among the total number of available threads, the maximum number of concurrently executing threads refers to the number of threads that can concurrently execute the maximum number of requests in which the number of concurrently executing threads is to be controlled.
Set the maximum number of concurrently executing threads in a Web container, Web application, and URL group.
(2) Number of dedicated threads
From among the total number of available threads, the number of dedicated threads refers to the number of threads that can definitely execute the requests in which the number of concurrently executing threads is to be controlled. By specifying the control in the Web application and URL group, you can secure the minimum number of threads in each Web application or each URL group.
(3) Size of a pending queue
When the requests in which the number of concurrently executing threads is to be controlled, reach the upper limit of the number of concurrently executing threads, you can specify the size of the request queue. Specify the number of requests to be stored in the queue as the queue size.
The conditions for saving requests in a pending queue are as follows:
- When available number of the shared threads is not specified, in the case number-of-concurrently-executing-threads < maximum-number-of-concurrently-executing-threads, and number-of-concurrently-executing-threads
number-of-dedicated-threads - When number-of-concurrently-executing-threads
maximum-number-of-concurrently-executing-threads
Note that if space is not available in a pending queue, the requests are not processed and an error is returned to the client.
You can set the size of a pending queue in the Web application and the URL group.
(4) Number of shared threads
The number of shared threads refers to the number of non-dedicated threads, from among the available threads. The number of shared threads includes the number of shared threads of the Web container, and the number of shared threads of the Web application.
- Number of shared threads in a Web container
The number of shared threads in a Web container is the number of threads shared by all the Web applications deployed on the Web container.
- Number of shared threads in a Web application
The number of shared threads in a Web application is the number of threads shared by all the processes included in the Web application.
The number of shared threads is calculated from the maximum number of concurrently executing threads and the number of dedicated threads.
For details on how to calculate the number of shared threads, see (5) Method to calculate the number of shared threads.
(5) Method to calculate the number of shared threads
This point describes how to calculate the number of shared threads in a Web container and the number of shared threads in a Web application. When you specify the settings to control the number of concurrently executing threads in the Web application, the number of shared threads in the Web application depends upon whether you specify the settings to control the number of concurrently executing threads in the URL group.
Note that the URL group does not have any shared threads. When you specify the method for controlling the number of concurrently executing threads in URL group of a Web application, the number of shared threads of the Web application is used.
- Number of shared threads in the Web container
When a Web application with the number of dedicated threads specified exists on the Web Container, the number of shared threads will be as follows:
- Total-number-of-shared-threads-in-the-Web-container =
- Maximum-number-of-concurrently-executing-threads-in-the-Web-container - Total-number-of-dedicated-threads-in-a-Web-application#
- # Total number of dedicated threads that are set in all Web applications deployed on the Web container.
The number of dedicated threads set in each Web application is the minimum number of threads to be secured in the Web application. This thread count is not used in the request processing of another Web applications.
- Number of shared threads in a Web application (When control of the number of concurrently executing threads in each URL group is specified)
- Number-of-shared-threads-in-a-Web-application =
- Maximum-number-of-concurrently-executing-threads-in-a-Web-application-unit - Total-number-of-dedicated-threads-in-URL-group#
- # Total number of dedicated threads in all the URL groups set in a Web application.
- Number of shared threads in a Web application (When control of the number of concurrently executing threads in each URL group is not specified)
- Number-of-shared-threads-in-a-Web-application = Maximum-number-of-concurrently-executing-threads-in-the-Web-application
The following figure shows an example for calculating the number of shared threads in a Web container and Web application when the number of concurrently executing threads is specified:
Figure 2-17 Example for calculating the number of shared threads
![[Figure]](figure/zu021400.gif)
- The number of shared threads in a Web Container = A - (total of B)
In this figure, the number of shared threads in a Web Container is 7 - (2 + 0) = 5.
- The number of shared threads in Web application 1 = C - (total of D)
The number of dedicated threads in each URL group is specified in Web application 1. In this figure, the number of shared threads is 3 - (2 + 0) = 1
- The number of shared threads in Web application 2 = The number of shared threads in the Web Container
The settings for controlling the number of concurrently executing threads are not specified in the Web application 2. Therefore, the number of shared threads in the Web Container is applied to the number of shared threads in the Web application 2. In the figure, the number of shared threads is 5.
- The number of shared threads in Web application 3 = The maximum number of concurrently executing threads
The number of dedicated threads in each URL group is not specified in Web application 3. Therefore, number of shared threads the Web application 3 is applied to the number of shared threads in Web application 3. In this figure, the number of shared threads is 2.