uCosminexus Application Server, Web Container Functionality Guide
(1) Example of setting the Web applications used in the description
In this example, out of the two Web applications deployed on the Web container, the setting to control the number of concurrently executing threads in the Web application as well as in the URL group is specified in one Web application. The settings are shown below:
- Maximum number of concurrent connections in the Web server: 40
- Maximum number of concurrently executing threads of Web container: 8
- Default size of the pending queue: 5
- Specifying the setting to control the number of concurrently executing threads in the Web application
Set the following contents in Web application A. Note that in Web application B, the setting is not specified to control the number of concurrently executing threads in the Web application.
Web application name |
Maximum number of concurrently executing threads |
Number of dedicated threads |
Size of pending queue of Web application |
Web application A |
7 |
3 |
5 |
- Specifying the setting to control the number of concurrently executing threads in the URL group
In Web application A, the setting of the following URL groups is specified. In Control C, the settings for controlling the number of concurrently executing threads in URL group are not specified.
URL group name |
URL pattern |
Maximum number of concurrently executing threads |
Number of dedicated threads |
Size of pending queue of Web application |
Control A |
/health_check.jsp |
1 |
1 |
1 |
Control B |
/create_pdf |
3 |
2 |
5 |
The following figure shows the example in which the thread count is controlled in the URL group:
Figure 2-23 Example of settings in the URL group
(2) Number of threads available in each Web application
The maximum number of concurrently executing threads, the number of dedicated threads, and the size of the pending queue that you can use in the case of the setup in figure 2-23 are illustrated below for each Web application or URL group. Note that the serial number of the description corresponds to the serial number mentioned in the figure.
- Web application A
The setting to control the number of concurrently executing threads is specified in the Web application A. In the business logics (Control A and Control B) of Web application A, the setting to control the number of concurrently executing threads in the URL group is specified.
The thread count of the Web application A is explained below:
- Maximum number of concurrently executing threads and the number of dedicated threads
Since the maximum number of concurrently executing threads and the number of dedicated threads is set, you can use the threads up to the respective set values.
You can concurrently execute maximum of 7 threads in the Web application A. Out of the seven threads you can secure minimum of three thread for the number of dedicated threads in Web application A.
- Number of shared threads
Calculate the number of shared threads that you can use in the entire Web application A by the following expression: Maximum number of concurrently executing threads in Web application A - Total number of dedicated threads. In this case, the number of shared threads will be 7 - 3, that is 4.
- Size of the pending queue of the Web application
The size of the pending queue of the Web application is specified in the Web application A. If seven threads are used concurrently in the entire Web application A, a maximum of five requests are accumulated in the pending queue. Note that this queue is used in the requests to the business logic Control C in the Web application, in which the settings to control the number of concurrently executing threads in the URL group is not specified.
- Control A (requests to /health_check.jsp)
- Maximum number of concurrently executing threads and the number of dedicated threads
Since the maximum number of concurrently executing threads and the number of dedicated threads is set in Control A, you can use the threads up to the respective set values.
In Control A, the maximum number of concurrently executable threads is one. This one thread also acts as the minimum number of dedicated threads that you can secure in Control A. Note that the number of dedicated threads in Control A is one of the dedicated threads in Web application A.
- Size of the pending queue of the URL group
The size of the pending queue of the URL group is specified in Control A. If one thread is in use in Control A, maximum one request is accumulated in the pending queue of the URL group.
- Control B (requests to /create_pdf)
- Maximum number of concurrently executing threads and the number of dedicated threads
Since the maximum number of concurrently executing threads and the number of dedicated threads is set in Control B, you can use the threads up to the respective set values.
In Control B, the maximum number of concurrently executable threads is three. Out of the three threads, you can secure minimum of two threads as the dedicated threads in Control B. Note that, , out of the dedicated threads in Web application 1, two threads serve as the dedicated threads in Control2.
- Size of the pending queue of the URL group
The size of the pending queue of the URL group is specified in Control B. If three threads are in use in Control B, maximum five requests are accumulated in the pending queue of the URL group.
- Control C process
The setting to control the number of concurrently executing threads is not specified for requests to business logic Control C in Web application A.
Perform the operation as follows:
- Maximum number of concurrently executing threads
The number of shared threads in Web application A is the maximum number of concurrently executing threads. Since the number of shared threads in Web application A is four, the maximum number of concurrently executing threads of the Control C processing is four.
Web application 1 does not contain any dedicated threads since the setting to control the number of concurrently executing threads is not specified. Therefore, if access to Control A or B is centralized and if the threads that can be used in the Web application A are lost, the processing of the Control C business logic remains pending.
- Size of the pending queue of the Web application
When the processing of business logic Control C is pending, the requests to the processing are accumulated in the queue. Since the size of the pending queue of the URL group is not specified in the business logic Control C, the requests are accumulated in the pending queue of the Web application A. A maximum of five requests are accumulated in the pending queue.
- Web application B
The settings to control the number of concurrently executing threads in Web application are not specified in Web application B.
Perform the operation as follows:
- Maximum number of concurrently executing threads
The number of shared threads in Web container is used as the maximum number of concurrently executing threads. You can calculate the number of shared threads in Web container by the following expression:
Maximum number of concurrently executing threads in Web container - Number of dedicated threads in Web application A
In this case, it will be 8 - 3, that is the maximum number of concurrently executing threads in Web application B will be 5.
- Size of default pending queue
When requests are pending in the Web application B, the requests to the Web application B are accumulated in the pending queue. Since the size of the pending queue of the Web application is not specified in the Web application B, the requests are accumulated in the default pending queue. A maximum of five requests are accumulated in the pending queue.
- Reference note
- In a Web container, the threads are even used for error processing of static contents and requests. The number of threads used for these objectives can be calculated from the following expression:
- Number-of-processing-threads-of-Web-server - (Maximum-number-of-concurrently-executing-threads-of-Web-container + Total-size-of-the-pending-queues#)
- # The total size of the pending queues refers to the value obtained by adding the size of the pending queues of the Web container, Web application A, Control A, and Control B, in this figure.
Therefore, in case of figure 3-16, the value will be 40 - (8 + (5 + 5 + 1 + 5)), that is the number of threads used for error processing of static contents and requests is 16.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.