uCosminexus Application Server, Web Container Functionality Guide

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

2.19.1 Overview of dynamically changing the number of concurrently executing threads

This subsection provides an overview of dynamically changing the number of concurrently executing threads.

Organization of this subsection
(1) Usage of dynamically changing the number of concurrently executing threads
(2) An example of setting change
(3) Operation after setting change
(4) Effect on the controlling of the number of concurrently executing threads in the URL group

(1) Usage of dynamically changing the number of concurrently executing threads

In a system built with Application Server, you can dynamically change the maximum number of concurrently executing threads, number of dedicated threads, and pending queue size of each Web application without stopping the service. You can change the maximum number of concurrently executing threads, number of dedicated threads, and pending queue size of each Web application with the management command (mngsvrutil) .

If the maximum number of concurrently executing threads of each Web application is changed, the following aspects can be supported:

Note that the items set here become invalid when you stop the service and the settings are not saved in J2EE server. Further, with this method you can change only the information related to a Web application. When you change the Web container settings, you have to restart the J2EE server to apply the changes.

When you want to change the maximum number of concurrently executing threads of each Web container or when you want to permanently change the maximum number of concurrently executing threads of a Web application, follow the procedure similar to the one used when building a system.

Note
When the maximum number of concurrently executing threads of a Web application is changed, the control operation for these threads of each URL group is affected depending on the relation between the maximum number of concurrently executing threads and the number of dedicated threads of each URL group. For details, see 2.19.1(4) Effect on the controlling of the number of concurrently executing threads in the URL group.

(2) An example of setting change

This subsection introduces an example of setting change for a specific Web application, in the case you want to improve the throughput and reduce the number of requests resulting in an error. In this example, the maximum number of concurrently executing threads, the number of dedicated threads, and the size of the pending queue of a Web application are increased. Note that you cannot change the maximum number of concurrently executing threads of Web container, and the maximum number of concurrently executing threads of URL group during dynamic change in the number of concurrently executing threads.

Table 2-60 An example of the dynamic change in the number of concurrently executing threads

Parameter Setting before change Setting after change
Maximum number of concurrently executing threads of Web container 10 --
Web application setup Maximum number of concurrently executing threads 7 8
Number of dedicated threads 4 5
Size of a pending queue 8 10

Legend:
--: The setting cannot be changed

(3) Operation after setting change

A change in the number of concurrently executing threads is applied immediately. You need to pay attention in the following operations, immediately after making changes:

When the maximum number of concurrently executing threads is changed
  • When the maximum number of concurrently executing threads is increased
    The requests that change to executable state from among the pending requests of the Web application are executed immediately.
  • When the maximum number of concurrently executing threads is reduced, since all the threads specified in the maximum number of concurrently executing threads are used.
    The requests that exceed the maximum number of concurrently executing threads after change are executed concurrently on a temporary basis.

When the number of dedicated threads is changed
  • When the number of dedicated threads is increased, since all the threads specified in the maximum number of concurrently executing threads of Web container are used
    If there are pending requests in a Web application in which the number of dedicated threads is increased, as many requests as the number of dedicated threads are executed immediately. In such cases, however, the requests that exceed the maximum number of concurrently executing threads of Web container are executed concurrently on a temporary basis.
  • When the number of dedicated threads is reduced
    When the number of dedicated threads is reduced, the number of threads shared in all the Web applications increases. In such cases, the requests in the pending state that change to executable state by increasing the number of threads shared in all Web applications, are executed immediately.

When the size of the pending queue of the Web application is changed
  • When the size of a pending queue is reduced, since requests are pending up to the upper limit of the queue in a pending queue of Web application
    Error HTTP 503 is returned for the requests that exceed the size of the pending queue.

(4) Effect on the controlling of the number of concurrently executing threads in the URL group

When you dynamically change the number of concurrently executing threads of the Web application in which the settings to control the number of concurrently executing threads in URL group is specified, the setting of the number of concurrently executing threads in URL group may be affected. The setting is affected due to the following changes:

When the maximum number of concurrently executing threads in Web application is reduced
When the following condition is satisfied by reducing the maximum number of concurrently executing threads in the Web application, the maximum number of concurrently executing threads in URL group is temporarily used as the number of concurrently executing threads in Web application.
Condition in which the maximum number of concurrently executing threads in URL group is changed
Maximum-number-of-concurrently-executing-threads-in-URL-group > Maximum-number-of-concurrently-executing-threads-in-Web-application
The setting of the maximum number of concurrently executing threads in URL group is however not changed. If the maximum number of concurrently executing threads in Web application reduces up to the number of threads set during dynamic change, and the maximum number of concurrently executing threads in URL group falls below the maximum number of concurrently executing threads in Web application, the maximum number of concurrently executing threads in URL group operates as per the setting.
Note that due to of this change, in order to continue the processing of running requests, the requests that exceed the maximum number of concurrently executing threads of Web application after change are executed concurrently on a temporary basis.

When the number of dedicated threads in Web application is reduced
If the number of dedicated threads in Web application is reduced, the number of dedicated threads set in all the URL groups of the Web application is no longer available. The conditions in which you cannot use the number of dedicated threads are explained below. Note that these conditions depend on the relationship between the maximum number of concurrently executing threads and the number of dedicated threads in Web application.
When the maximum number of concurrently executing threads in Web application = Number of dedicated threads in Web application
When the following expression is fulfilled, you cannot use the number of dedicated threads set in the URL group.
Number-of-dedicated-threads-in-Web-application [Figure] Total-number-of-dedicated-threads-in-URL-group
When the maximum number of concurrently executing threads in Web application [Figure] Number of dedicated threads in Web application
When the following expression is fulfilled, you cannot use the number of dedicated threads set in the URL group.
Number-of-dedicated-threads-in-Web-application < Total-number-of-dedicated-threads-in-URL-group