5.2.1 Mechanism of request distribution with the Redirector
If you use the redirector, from among the HTTP requests sent to the Web server, specific requests can be processed in the specified Web container, and requests can be processed by distributing to multiple Web containers.
In the case of distributing requests with the redirector, use the Web container execution process, called the worker process# that runs behind the Web server. A worker process is used to process requests including servlets and JSPs, via the redirector. Data exchange between the Web server and a worker process is based on TCP/IP and is executed through a specific port number set by the user. To specify the redirector settings, use the setup unit that abstracts the Web container called worker. The worker includes a worker indicating a stand-alone J2EE server and a worker indicating a J2EE server in a cluster configuration. The worker that forwards requests to the J2EE server is called a forwarding worker. A forwarding worker is the ajp13 type worker.
- #
-
A worker process actually acts as a J2EE server.
- Organization of this subsection
(1) Patterns to transfer the requests
The patterns to transfer requests from the redirector to the worker process are as follows:
-
Transfer from one Web server to one worker process
-
Transfer from one Web server to multiple worker processes
Note that the mechanism of request distribution is not affected even if the Web server and the worker processes are present on the same machine or on different machines.
The following figures show the patterns to transfer requests from the redirector to the worker process:
|
|
|
|
To distribute the requests to multiple Web containers, define the worker processes of multiple Web containers as the distribution destinations, in the redirector registered in the Web server.
(2) Request distribution method
The methods to distribute requests with the redirector include:
-
Distributing by URL pattern
Use this method when you want to execute a specific processing in a single Web container, and when you want to distribute a process to multiple Web containers.
You can use this method when there is one worker process, as well as when there are multiple worker processes.
-
Distributing in round-robin format with a load balancer
Use this method when you want to distribute a process to multiple Web containers.
-
Distributing by the POST data size
Use this method when you want to distribute a process to multiple Web containers. You can specify this distribution method only when the Web server used is Cosminexus HTTP Server.
Note that you cannot use this distribution method when the following functionality are used:
-
Session failover functionality
-
Distributing requests by the round robin format
-
To create a worker process, define the following attributes in a file (workers.properties) called the worker definition file:
-
Worker name
-
Worker type
-
Host name or IP address of the Web server on which the worker is running
-
Port number received by the worker
The following workers are already defined in a standard workers.properties file. When the Web server and the Web container are operated on the same host, you need not change these parameters.
|
Worker attributes |
Parameter |
|---|---|
|
Worker name |
worker1 |
|
Worker type |
ajp13 |
|
Host name |
Localhost |
|
Port number |
8007 |
For details on how to define a worker process, see 14.2.4 workers.properties (Worker definition file).