6.5.2 Execution environment settings (J2EE server settings)
To control the number of concurrent connections from the Web client, you must set a J2EE server.
The setting method and example of controlling the number of concurrent connections from the Web client are described here.
- Organization of this subsection
(1) How to set
Specify the definition for controlling the number of concurrent connections from the Web client in the following parameter in the <configuration> tag of the logical J2EE server (j2ee-server), in the Easy Setup definition file:
- webserver.connector.inprocess_http.rejection_threads
-
Specifies the number of requests for which connection is rejected.
For details on the Easy Setup definition file and parameters to specify, see Part 3 Reference (V9 Compatibility Mode).
- Important note
-
When displaying a page with a frame or a page with an image inserted, multiple requests might be received from the Web client. In this case, the pages displayed by the controlling of the number of concurrent connections from the Web client might result in partial errors.
(2) Example settings
The example of settings for controlling the number of concurrent connections from the Web client is described here.
The following is an example of settings wherein the upper limit of number of request processing threads is 40 and the number of request processing threads for which the connection is rejected is 1:
... <param> <param-name>webserver.connector.inprocess_http.max_connections</param-name> <param-value>40</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.rejection_threads</param-name> <param-value>1</param-value> </param> ...
In this example, the number of Web clients that can process requests concurrently after connection is 39. If the number of threads that are processing requests reaches 39, the remaining 1 thread keeps returning error to the Web client.
By controlling the number of concurrent connections from the Web client, an error of the status code 503 (Service Unavailable) is returned to the Web client for the requests for which connection is rejected. At this time if you customize the error page returned to the client, you can customize the response message or redirect to another server. The following are the setting examples for each of these cases. For details on customizing the error page, see 6.15 Error page customization (In-process HTTP server).
-
To customize the response message
The following is an example of settings for returning a specific file as the response body to the Web client when the connection from the Web client is rejected:
... <param> <param-name>webserver.connector.inprocess_http.rejection_threads</param-name> <param-value>3</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.list</param-name> <param-value>REJECTION_1</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.status</param-name> <param-value>503</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.file</param-name> <param-value>C:/data/busy.html</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.file.content_type=text/html; charset</param-name> <param-value>ISO-8859-1</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.request_url</param-name> <param-value>/*</param-value> </param> ...
In this example, 503 is specified in the error status code, C:/data/busy.html is specified in the corresponding error page file, 'text/html; charset=ISO-8859-1 (Media-Type is text/html and ISO-8859-1 character set is used)' is specified in the Content-Type header of the response, and /* is specified in the URL pattern. Therefore, when error status code '503' occurs, regardless of the request URI, the contents of C:/data/busy.html file are returned as a response.
-
To redirect a request to another server
The following is an example of settings for redirecting a request for which connection is rejected to another server:
... <param> <param-name>webserver.connector.inprocess_http.rejection_threads</param-name> <param-value>3</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.list</param-name> <param-value>REJECTION_1</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.status</param-name> <param-value>503</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.redirect_url</param-name> <param-value>http://host1/busy.html</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.request_url</param-name> <param-value>/*</param-value> </param> <param> ...
In this example, 503 is specified in error status code, http://host1/busy.html is specified in the corresponding error page file, and /* is specified in the URL pattern. Therefore, when error status code '503' occurs, regardless of the request URI, all the requests are redirected to the http://host1/busy.html URL.