Learn about the Dispatcher component of Load Balancer.
The Dispatcher component balances traffic among your servers through
a unique combination of load balancing and management software. Dispatcher
can also detect a failed server and forward traffic around it. Dispatcher
supports HTTP, FTP, SSL, SMTP, NNTP, IMAP, POP3, Telnet, SIP, and
any other TCP or stateless UDP-based application.
All client requests that are sent to the Dispatcher machine are
directed to the best server according to weights that are set dynamically.
You can use the default values for those weights or change the values
during the configuration process.
Dispatcher offers three forwarding methods:
- MAC forwarding method: Use this forwarding method to load balance
the incoming requests among the servers in same subnet. The servers
respond directly to the client, bypassing the Dispatcher.
- NAT forwarding method: This forwarding method removes the limitation
of the servers being required to be in same subnet as the Dispatcher.
With the NAT forwarding method, Dispatcher load balances the incoming
requests to the servers, the servers respond to the Dispatcher and
the Dispatcher then forwards the response to the client.
- Encapsulation forwarding: This forwarding method is midway between
the NAT and MAC forwarding methods. First, encapsulation forwarding
enables the servers to be in a subnet different from the Dispatcher
machine. Second, servers respond directly to the client, bypassing
the Dispatcher. Dispatcher supports two encapsulation protocols: GRE
and IPIP. Not all operating systems support both GRE and IPIP protocols,
hence their support is operating system dependent.
The Dispatcher component is the key to stable, efficient management
of a large, scalable network of servers. With Dispatcher, you can
link many individual servers into what seems to be a single, virtual
server. Your site is presented as a single IP address to the world.
Dispatcher functions independently of a domain name server; all requests
are sent to the IP address of the Dispatcher machine.
Dispatcher brings distinct advantages in balancing traffic load
to clustered servers, resulting in stable and efficient management
of your site.
Dispatcher component features:
- High availability
- To use Dispatcher to remove single point-of-failure limitations
in your network, read the Configuring High availability topic.
- Client to server affinity
- To ensure that the client uses the same server for multiple connections,
read the Optimize connections with client-to-server affinity for the
Dispatcher component topic.
- Rules-based load balancing
- To run Dispatcher on the same machine as one of the managed servers
that you are load balancing, read the Configuring collocated servers
for the Dispatcher component topic.
- Wide area load balancing
You can achieve wide area load balancing through two methods:
Encapsulation Forwarding and Network Address Translation (NAT).
To
load balance to remote servers by using Dispatcher’s Encapsulation
Forwarding, read the Use encapsulation forwarding to forward traffic
across network segments topic.
To load balance to remote servers
by using Dispatcher’s NAT forwarding method, read the Using NAT forwarding
to forward traffic topic.
- Alerts
- To generate alerts when servers are marked up or down, read the
Sample scripts to generate alerts and record server failure.
- Collocation
- To run Dispatcher on the same machine as one of the managed servers
that you are load balancing, read the Using collocated servers for
the Dispatcher component topic.
Functions that provide load balancing
The
primary functions of Dispatcher interact with each other and your
server configuration to balance network traffic in your environment.
Dispatcher consists of the following functions:
- The dsserver command handles requests from
the command line to the executor, manager, and advisors.
- The executor supports port-based load balancing of TCP connections.
It is able to forward connections to servers based on the type of
request received (for example, HTTP, FTP, SSL). The executor always
runs when the Dispatcher component is being used for load balancing.
- The manager sets weights that are used by the executor that is
based on:
- Internal counters in the executor
- Feedback from the servers that are provided by the advisors
- Feedback from a system-monitoring program, such as Metric Server
or WLM.
- Using the manager is optional; however, if the manager is not
used, load balancing is performed by using weighted round-robin scheduling,
based on the current server weights, and advisors are not available
- The advisors query the servers and analyze results by protocol
before calling the manager to set weights as appropriate. Currently
there are advisors available for the following protocols: HTTP, FTP,
SSL, SMTP, NNTP, IMAP, POP3, SIP, and Telnet.
Dispatcher also offers advisors that do not exchange protocol-specific
information, such as the DB2® advisor
that reports on the health of DB2 servers
and the ping advisor that reports whether the server responds to a
ping. For a complete list of advisors, Read the List of advisors topic.
You also have the option of writing your own advisors (see Creating
a custom advisor).
Tip: Using the advisors is optional,
but recommended.
Configure and manage the executor, advisors,
and manager by using the command line (dscontrol)
or the graphical user interface (lbadmin).
The
three key functions of Dispatcher (executor, manager, and advisors)
interact to balance and dispatch the incoming requests between servers.
Along with load balancing requests, the executor monitors the number
of new connections, active connections, and connections in a finished
state. The executor also does garbage collection of completed or reset
connections and supplies this information to the manager.
The
manager collects information from the executor, the advisors, and
a system-monitoring program, such as Metric Server. Based on the information
the manager receives, it adjusts how the server machines are weighted
on each port and gives the executor the new weighting for use in its
balancing of new connections.
The advisors monitor each server
on the assigned port to determine the server's response time and availability
and then give this information to the manager. The advisors also monitor
whether a server is up or down. Without the manager and the advisors,
the executor does round-robin scheduling that is based on the current
server weights.
Managing local servers with Dispatcher
You
can install the Dispatcher machine without making any physical changes
to the network. After a client request is directed to the optimal
server by the Dispatcher, the response is sent directly from server
to client with no involvement by the Dispatcher when you are using
the MAC forwarding method.
Physical representation
of the site that uses an Ethernet network configuration. 
Managing local and remote servers with Dispatcher
Wide
area support in Dispatcher enables you to use both local and remote
servers (servers on different subnets). The figure shows a configuration
where one local Dispatcher (Dispatcher 1) serves as the entry point
for all requests. It distributes these requests among its own local
servers (ServerA, ServerB, ServerC) and to the remote Dispatcher (Dispatcher
2), which load balances to its local servers (ServerG, ServerH, ServerI).
When you use Dispatcher's NAT forwarding method or GRE support, wide
area support with Dispatcher can also be achieved without using a
Dispatcher at the remote site (where ServerD, ServerE, and ServerF
are located).
Physical representation of a site that
uses an Ethernet network configuration.