uCosminexus Application Server, Web Container Functionality Guide

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

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:

  1. 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.
  2. 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.
  3. 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

(1) Maximum number of concurrently executing threads in URL group

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:
  1. Number of shared threads in Web container unit
  2. 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.

(2) Number of dedicated threads in URL group

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.

(3) Pending queue in URL group

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.

(4) Setting the URL patterns

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:

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:

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.

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.