summaryrefslogtreecommitdiff
path: root/TAO/examples/Load_Balancing/README
blob: 91178a5c31009178ab17c3e9178a5072d0d6ea5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139


CONTENT:

INTRO
SOURCE FILES
SERVICE DESCRIPTION
EXAMPLE DESCRIPTION
HOW TO RUN
COMMAND-LINE OPTIONS


INTRO

This directory contains: 1) definition and implementation of a simple
CORBA Load Balancing Service and 2) client and server illustrating the
use of this service.


SOURCE FILES

Load_Balancer.idl
Load_Balancer_i.h
Load_Balancer_i.cpp:
                      Load Balancing Service interface and its
                      implementation.

Load_Balancing_Service.h
Load_Balancing_Service.cpp:
                      Load Balancing Service driver.

Identity.idl
Identity_i.h
Identity_i.cpp:
                     Interface and implementation of a simple CORBA
                     object used in the client-server example.

Identity_Server.cpp
Identity_Client.cpp:
                    Client and server example, illustrating the use of the
                    Load Balancing Service.


SERVICE DESCRIPTION

For interface and detailed description see Load_Balancer.idl.  Two
load balancing protocols are supported: random and round-robin.
Servers register their objects with either random or round robin
object groups, and clients request object references from those groups.

This is a very basic approach to load balancing: there is no feedback
mechanism to allow registered servers to notify Load Balancing service of
how busy they are.  Also, the use of the service is not transparent to
client applications.

The service can be used in different ways.  Depending
on the system and its characteristics, it might make more sense for a
client to either 1) obtain a new object reference from the Load
Balancing service for each invocation or 2) obtain new references from
the Load Balancing service at certain intervals, measured in time or
number calls or 3) use the Load Balancing service just once, to obtain
the initial object reference.

Related material:

      - Persistent version of this Load Balancing Service can be found
        in TAO/examples/Load_Balancing_persistent.

      - TAO's Load Balancing Service (definition, implementation and
        tests are located in TAO/orbsvcs tree) This is a more
        sophisticated Load Balancing implementation, which is
        distributed as one of TAO's Object Services.


EXAMPLE DESCRIPTION

Simple client and server are provided to illustrate the use of the
Load Balancing service (LB).  The server creates two object groups in
the LB, one random and one round robin.  It then creates the specified
number of <Identity> objects and registers them with the random object
group in LB.  Same is done with the round robin group.  The client
performs the specified number of invocation on <Identity> object,
contacting the specified group of LB for a new object reference before
each invocation.

HOW TO RUN

run_test.pl perl script can be used to run the example, i.e., the Load
Balancing service, the server and the client.  (The output from the
perl script is somewhat confusing since it is a mixture of output from
client, server and load balancing service.)  Alternatively, the
example (or just the load balancing service) can be started manually.

First, start the Load Balancing service, specifying the file where to
store its ior.  Then start the server, and, finally, the client, as
shown below. Run each executable in its own window for output readability.
Command-line options are described in the next section.

$ load_balancer -o balancer.ior
$ server -i file://balancer.ior
$ client -i file://balancer.ior


COMMAND LINE OPTIONS

Load_Balancing Service:

 -d
                increase debug output
 -o <file_name>
                output file for the <Object_Group_Factory> ior


Server:

 -d
                increase debug output
 -i <ior>
                ior of the <Object_Group_Factory> object
 -a <number>
                number of objects to create/register with the random
                group (default value is 5)
 -o <number>
                number of objects to create/register with the round
                robin group (default value is 5))


Client:

 -d
                increase debug output
 -i <ior>
                ior of the <Object_Group_Factory> object
 -n <number>
                number of times to make invocation on Identity object
                (default value is 5)
 -r
                use random group for obtaining references (as opposed
                to the round robin group) (default value is use round robin)