|
One of the more important properties for a worker instance that can be set in the worker.properties
file is the type of the worker. Each defined Tomcat worker must be assigned a type. Tomcat 6 integration
with the mod_jk Connector supports the following types of workers:
❏ ajp13 : This type of worker represents a running Tomcat instance. There are various possible
attributes for this worker. The main attributes include tomcatId (which represents the identity
of the Tomcat instance), channel (which indicates the communication channel associated with
this worker), and max_connections (which is used to specify the maximum number of connections).
By default, the maximum number of connections is unlimited. The default port for
AJP 1.3 is 8009.
❏ lb : This type of worker is used for load balancing . In a load-balancing scenario, the worker
doesn’t actually process any requests. Rather, it handles the communication between a Web
server and other defined Tomcat workers of type ajp13 . The worker supports round-robin load
balancing with a certain level of fault tolerance. One of the main properties for this worker is
worker , which indicates the name of the worker to be used as a load balancer. A number of attributes
are provided by the lb worker. Some of the attributes are explained later in this chapter.
❏ status : This is a special type of worker that is used to show useful information about how the
load among the various Tomcat workers is distributed. It does not process any request, and is
not associated with any Tomcat worker instances. To use it, add a mapping of URL using the
JkMount directive assigned to this worker. Its use is explained in the section “Tomcat Load
Balancing with Apache,” later in this chapter. The jkstatus Web page (again, described later)
typically displays some very vital information, including the available number and names of
workers, the associated lb_factor , and their locations. It also indicates the number of requests
served by a specific worker and any context mappings served. If any worker goes into an error
state, this can be easily detected from this page.
❏ jni : Used in-process, this worker handles the forwarding of requests to in-process Tomcat
workers using JNI. In the in-process mode, the Tomcat Web container and the Web server share
the same memory address space. They communicate via interprocess communication. This
worker holds the details of the Tomcat class to start up, and which parameters to pass. There are
two predefined jni workers: onStartup and onShutdown . These are executed during the
startup and shutdown phase of the connector, respectively. Both must exist in the configuration
in order to be able to start and shut down Tomcat. See the accompanying box about in-process
workers. |
|