uCosminexus Application Server, Web Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

2.17.2 Parameters required for controlling the number of concurrently executing threads (Web applications)

An overview of the parameters required for controlling the number of threads in each Web application is as follows:

Set the maximum number of concurrently executing threads in the Web container. Note that the maximum number of concurrently executing threads set here is shared in all the Web applications deployed on the Web container.

Set the following parameters in the Web application for which you want to control the number of concurrently executing threads:

The details on the parameters required for specifying to control the number of concurrently executing threads in the Web applications are as follows:

Organization of this subsection
(1) Maximum number of concurrently executing threads in the Web application
(2) Number of dedicated threads of the Web application
(3) Size of a pending queue of Web application

(1) Maximum number of concurrently executing threads in the Web application

If the value for maximum number of concurrently executing threads in the Web application is set, that value is applied. This subsection explains the concept of the maximum number of concurrently executing threads in the Web applications for which the number of concurrently executing threads and the number of dedicated threads is not set.

(a) In the case of the Web application in which you do not specify the setting to control the number of concurrently executing threads

The maximum number of concurrently executing threads of the Web application in which you dot set the maximum number of concurrently executing threads, is as follows:

Maximum-number-of-concurrently-executing-threads =
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.
(b) In the case of the Web application in which dedicated threads are not set

When specifying the setting to control number of concurrently executing threads in the Web application, the setting of the number of dedicated threads is optional. The smaller value in the following two values is applicable as the maximum number of concurrently executing threads of a Web application in which the number of dedicated threads is not set:

Maximum-number-of-concurrently-executing-threads =
Maximum-number-of-concurrently-executing-threads-set-in-the-Web-application
or
Maximum-number-of-concurrently-executing-threads-in-the-Web-container - Total-number-of-dedicated-threads-in-a-Web-application#
#
Total number of dedicated threads set in all the Web applications deployed on the Web container.

(2) Number of dedicated threads of the Web application

When only the number of concurrently executing threads in the Web container is set, and if the access is centralized to another Web application in the Web container, the threads are used in the application for which the access is centralized. You can secure the minimum number of threads required for execution in the Web application by setting the number of dedicated threads. Therefore, even if the access is centralized to another Web application in the Web container, you can execute the requests without waiting.

(a) Operation of the Web application depending on the presence or absence of the settings for the number of dedicated threads

The following figure shows the number of dedicated threads in the Web application, and illustrates the operations of two Web applications in which one is without the number of dedicated threads set and the other is with the number of dedicated threads set:

Figure 2-20 Number of dedicated threads in the Web applications

[Figure]

The contents of the figure are explained below. Web application 1 and Web application 2 are running in the Web container. The settings to control the number of concurrently executing threads are not specified in Web application 2, while it is specified in Web application 1. In Web application 1, the maximum number of concurrently executing threads is set as 3, and the number of dedicated threads is set as 1.

For example, if the access is centralized in Web application 2, and the number of dedicated threads is not set in Web application 1, all the threads are used in Web application 2. As illustrated in the figure, by setting the number of dedicated threads in Web application 1, you can secure at least one thread in Web application 1 even when the access is centralized in Web application 2. Consequently, you can ensure the processing of Web application 1 in which the number of dedicated threads is set.

As described in the above example, if you set the number of dedicated threads, then even if the access is centralized in another business, you can certainly execute the Web application. Therefore, Hitachi recommends that you set the number of dedicated threads in highly important Web applications, such as applications for management.

Note that the threads equal to the specified number of dedicated threads are not used in request processing of another applications. It is optional to set the number of dedicated threads in the settings for controlling the number of concurrently executing threads in Web application.

(b) Number of dedicated threads and maximum number of concurrent connections

When the maximum number of concurrent connections of the Web server (when the Web server integration functionality is used) or the maximum number of concurrent connections from the Web client (when the in-process HTTP server is used) are less and if the maximum number of concurrent connections are occupied by the requests to the Web applications in which the number of dedicated threads is not set, even when the Web applications with the number of dedicated threads set are accessed, the requests remain pending and an error occurs on the Web server or on the in-process HTTP server.

To properly execute a Web application in which the number of dedicated threads is set, without any dependency on the access flow to other Web applications, you need to set an appropriate value in the maximum number of concurrent connections. The method for setting the maximum number of concurrent connections is explained below:

(3) Size of a pending queue of Web application

Set the size of a pending queue of a Web application.

If you set the maximum number of concurrently executing threads in the Web application, the requests are accumulated in a queue when the number of executing threads reaches the maximum number. At this point, you can specify the size of the pending queue in the Web application.

The setting up of the size of the pending queue of a Web application depends upon whether you specify the number of concurrently executing threads in the Web application.

Operations of the pending queue of the Web application and default pending queue
In the case of multiple setting (including the setting for size of a pending queue of Web application and the default size of a pending queue) of a pending queue, the requests executed by using the number of shared threads are processed in an order starting from the first arrived request in the queue.

Maximum number of concurrent connections of the Web server and the pending queue of the Web application and default pending queue (when the Web server integration functionality is used)
The maximum number of concurrent connections in the Web server is the upper limit for the multiplicity of the requests transferred to the Web container from the Web server. As a result, when setting the number of dedicated threads, specify a number smaller than the maximum number of concurrent connections in the Web server, as the size of the pending queue of the Web application and default pending queue.

Maximum number of concurrent connections from the Web clients and the pending queue of the Web application and default pending queue (when the in-process HTTP server is used)
The upper limit value for the multiplicity of the number of connections from the Web client is as follows:
Maximum-number-of-concurrent-connections-from-the-Web-client - Number-of-requests-for-which-connection-is-denied
As a result, when setting up the number of dedicated threads, specify a number smaller than the maximum number of concurrent connections from the Web clients, as the size of the pending queue of the Web application and default pending queue.
Note that if the maximum number of concurrent connections from the Web client is greater than Sum-of-size-of-the-pending-queue-of-Web-application-and-default-pending-queue + Maximum-number-of-concurrently-executing-threads-in-Web-Container, you are not required to control the number of concurrent executions from the Web client with the in-process HTTP server. Also, if the maximum number of concurrent connections from the Web client is smaller than Sum-of-size-of-the-pending-queue-of-Web-application-and-default-pending-queue + Maximum-number-of-concurrently-executing-threads-in-Web-Container, an error can be returned immediately to the client without the occurrence of connection pending, by controlling the number of concurrent executions from the Web client through the in-process HTTP server.
Hint
Operation of the requests when the number of concurrently executing threads reaches the maximum number
When the number of concurrently executing threads in Web application reaches the maximum number, requests are accumulated in the queue, if there is a space in the queue. Once the on-going request processing finishes, requests are extracted sequentially from the queues and are executed. Note that if there is no space in the queue, the requests result in an error, and error HTTP 503 is returned to the client.