uCosminexus Application Server, Web Container Functionality Guide
2.18.3 Parameters required for controlling the number of concurrently executing threads (URL group)
This subsection explains the settings to control the thread count in the URL group. You need to specify the following settings to control the thread count in the URL group:
- Specifying the setting to control the number of concurrently executing threads in the Web container
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.
For details on specifying the setting to control the number of concurrently executing threads in the Web container, see 2.16 Controlling the number of concurrently executing threads in the Web container.
- Specifying the setting to control the number of concurrently executing threads in the Web application
Set the number of concurrently executing threads and the number of dedicated threads in the Web application. Note that when setting the number of concurrently executing threads in the URL group, it is mandatory to set the number of dedicated threads in the Web application.
For details on specifying the setting to control the number of concurrently executing threads in the Web application, see 2.17 Controlling the number of concurrently executing threads in the Web application.
- Specifying the setting to control the number of concurrently executing threads in the URL group
To control the number of concurrently executing threads in the URL group, set the following parameters in the URL group of the Web application in which the setting to control the number of concurrently executing threads in Web application is specified:
- Definition name of the control of number of concurrently executing threads in URL group
Set the name of the URL group that is the unit to control the number of concurrently executing threads.
- Maximum number of concurrently executing threads
Set the maximum number of threads that you can concurrently execute in the URL group.
- Number of dedicated threads
Set up the number of dedicated threads in the URL group.
- Size of the pending queue of the URL group
Set the size of a pending queue in the URL group.
- URL pattern
Specify the URL pattern to distribute the request URL in which the number of threads is to be controlled.
The detailed settings to control the number of concurrently executing threads in the URL group are explained below:
- Organization of this subsection
- (1) Maximum number of concurrently executing threads in URL group
- (2) Number of dedicated threads in URL group
- (3) Pending queue in URL group
- (4) Setting the URL patterns
The thread count used in the URL group refers to the thread count of the Web application to which the URL group belongs. Consequently, if one thread is used in the URL group, it implies that one thread is executed even in the Web application that includes the URL group.
Note that for a request URL in which the maximum number of concurrently executing threads of URL group is not set, the number of shared threads in the Web application is used. The number of shared threads in the Web application is as follows:
- Number of shared threads in Web application unit =
- Maximum number of concurrently executing threads in Web application unit# - Total number of dedicated threads in URL group
- # The smaller value in following 1. and 2., is applied as the maximum number of concurrently executing threads:
- Number of shared threads in Web container unit
- Value set as the maximum number of concurrently executing threads in Web application
In such a case, the number of shared threads in Web application needs to be at least 1. If the number of shared threads is 0 or less, an error occurs. For details, see 2.17.7 Notes on controlling the number of concurrently executing threads in the Web application.
Set the number of dedicated threads in URL group to execute specific business logic without being affected by other business logics in the Web application.
Specify the number of dedicated threads in URL group within the range of the number of dedicated threads set in the Web application. As a result, if the number of dedicated threads is not set in the Web application that includes the URL group, you cannot set the number of dedicated threads even in the URL group.
If the number of requests to the request URL in which the setting to control the number of concurrently executing threads in the URL group is specified exceeds the number of dedicated threads in URL group, and if the value is less than the maximum number of concurrently executing threads in the URL group, the requests are processed by using the number of shared threads in the Web application. As a result, if the number of shared threads in the Web application is less, be careful that the maximum number of concurrently executing threads in URL group will be even lesser than the set value.
The pending queue in the URL group refers to the queue in which requests enter when the number of concurrently executing threads in URL group reaches the upper limit. The pending queue in URL group is created for each URL group when the setting to control the number of concurrently executing threads in the URL group is specified. Set the size of this pending queue.
Requests enter a pending queue when the number of concurrently executing threads in a URL group reaches the upper limit, and the pending queue of the URL group has some space. The requests in the pending queue of the URL group are extracted sequentially from the pending queue, and executed after the processing of the request is complete. If the number of concurrently executing threads in the URL group reaches the upper limit and there is no space in the pending queue of the URL group, an error occurs, and then HTTP status code 503 is returned to the client.
Note that the requests entering the pending queue of the URL group do not enter the default pending queue and the pending queue of the Web application. The pending queue of the Web application is used for the requests that do not correspond to the request URL set for controlling the number of concurrently executing threads in the URL group.
Set the URL patterns for distributing the request URL. You can specify the URL patterns for the servlet mapping in Servlet specifications. You can specify the following URL patterns:
- A string beginning with "/"
Example: /index.jsp
- A string beginning with "/" and ending with "/*"
Example: /test/*
- A string beginning with "*."
Example: *.do
For details on the order of mapping the request URL with the URL pattern, see 2.18.2 Mapping of URL patterns.
To control the number of concurrently executing threads in the URL group, you must simultaneously specify settings to control the number of concurrently executing threads in the Web applications and the settings to control the number of threads in the Web Container. The following table lists the parameters specified for controlling the number of concurrently executing threads in the URL group:
Table 2-57 Parameters specified for controlling the number of threads in the URL group
Set parameters |
Set units |
Web Container |
Web application |
URL group |
Whether to control the number of concurrently executing threads |
-- |
Y |
-- |
Maximum number of concurrently executing threads |
Y |
Y |
Y |
Number of dedicated threads |
-- |
Y |
Y |
Size of a pending queue |
-- |
Y |
Y |
Default size of a pending queue |
-- |
Y |
-- |
Definition name of the control of number of concurrently executing threads in URL group |
-- |
-- |
Y |
URL pattern to be controlled |
-- |
-- |
Y |
- Legend:
- Y: Specified
- --: Not applicable
The settings for controlling the number of concurrently executing threads in the URL group are described here. Use the server management commands to specify settings for controlling the number of concurrently executing threads in the URL group. For details on the parameters set in the Web Container, see 2.16.2 Execution environment settings (J2EE server settings) and for details on the settings for each Web application parameter, see 2.17.5 Execution environment settings.
You can set the followings in the server management commands:
- Definition name of the control of number of concurrently executing threads in URL group
Specifies the URL group name in which the number of concurrently executing threads is controlled. The group name must be unique in the Web application.
The characters that can be used are as follows:
- Alphanumeric characters (A-Z, a-z, 0-9)
- One-byte hyphen (-)
- One-byte underscore (_)
The length of the string is 1 to 64.
- Maximum number of concurrently executing threads in each URL group
Specify the maximum number of threads that you can concurrently execute in a URL group. The specifiable range is as follows:
- Setup range for Maximum number of concurrently executing threads
- 1 Maximum-number-of-concurrently-executing-threads (URL-group) Maximum-number-of-concurrently-executing-threads (Web-application)
- Number of dedicated threads in the URL group
Specify the minimum number of threads to be secured in the URL group (number of dedicated threads). The specifiable range is as follows:
- Setup range for the number of dedicated threads
- 0 number-of-dedicated-threads (URL-group) Maximum-number-of-concurrently-executing-threads (URL-group)
- Furthermore, the number of dedicated threads in the URL group must be less than the number of dedicated threads in the Web application.
Also, the sum of the number of dedicated threads set in the URL group in the Web application must fulfill the following conditions. Note that these conditions depend on the values of the maximum number of concurrently executing threads and the number of dedicated threads in Web application.
- In the Web application settings, when Maximum-number-of-concurrently-executing-threads number-of-dedicated-threads
- Number-of-dedicated-threads (Web-application) Sum-of-number-of-dedicated-threads (URL-group)
- In the Web application settings, when Maximum-number-of-concurrently-executing-threads = number-of-dedicated-threads
- Number-of-dedicated-threads (Web-application) > Sum-of-number-of-dedicated-threads (URL-group)
Specify 0 when you do not want to set the number of dedicated threads.
- Size of the pending queue of the URL group
When the number of executing threads reaches the maximum number, the request is accumulated in the queue. Specify the pending queue size at this time for each URL group. The specifiable range is as follows:
- Setup range for the size of the pending queue of the URL group
- 0 pending-queue-size (URL-group) 2,147,483,647
If you specify 0, the pending queue of the URL group will not be used. At this time, if the number of concurrently executing threads reaches the upper limit, the requests will result in an error.
- URL pattern to be controlled
Specify the URL for which you want to control the number of concurrently executing threads. Specify a unique name in the Web application for the URL pattern. Also, specify the URL below the Web application context.
When using the server management commands, set the number of concurrently executing threads in the <urlgroup-thread-control> tag under the <thread-control> tag of the WAR property file.
- Specify the definition name for controlling the number of concurrently executing threads in the <urlgroup-thread-control-name> tag.
- Specify the maximum number of concurrently executing threads in the URL group in the <urlgroup-thread-control-max-threads> tag.
- Specify the number of dedicated threads in the <urlgroup-thread-control-exclusive-threads> tag.
- Specify the size of the pending queue of the URL group in the <urlgroup-thread-control-queue-size> tag.
- In the <urlgroup-thread-control-mapping> tag, specify the URL pattern you want to control enclosed in the <url-pattern> tag.
Acquire the property file using the cjgetappprop command of server management commands, and after editing the property file, apply the edited contents using the cjsetappprop command. For the server management commands, see 3. Basic Operation of Server Management Commands in the uCosminexus Application Server Application Setup Guide.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.