HP OpenVMS Alpha Partitioning and Galaxy Guide |
OpenVMS Galaxy CPU Load Balancer Program |
|
|
|
| |
The program must be run on each participating instance. Each image creates, or maps to, a small shared memory section and periodically posts information regarding the depth of that instance's COM queues. Based upon running averages of this data, each instance determines the most and the least busy instances. If these factors exist for a specified duration, the least busy instance having available secondary processors reassigns one of its processors to the most busy instance, thereby effectively balancing processor usage across the OpenVMS Galaxy. The program provides command-line arguments to allow tuning of the load-balancing algorithm. The program is admittedly shy on error handling.
This program uses the following OpenVMS Galaxy system services:
| Service | Description |
|---|---|
|
SYS$CPU_TRANSITION
|
CPU reassignment
|
|
SYS$CRMPSC_GDZRO_64
|
Shared memory creation
|
|
SYS$SET_SYSTEM_EVENT
|
OpenVMS Galaxy event notification
|
|
SYS$*_GALAXY_LOCK_*
|
OpenVMS Galaxy locking
|
Because OpenVMS Galaxy resources are always reassigned via a push model, where only the owner instance can release its resources, one copy of this process must run on each instance in the OpenVMS Galaxy.
This program can be run only in an OpenVMS Version 7.2 or later multiple-instance Galaxy.
Required Privileges ![]()
The CMKRNL
privilege is required to count CPU queues. The SHMEM privilege is
required to map shared memory.
Build and Copy Instructions ![]()
Compile
and link the example program as described in the following section,
or copy the precompiled image found in SYS$EXAMPLES:GCU$BALANCER.EXE
to SYS$COMMON:[SYSEXE]GCU$BALANCER.EXE.
If your OpenVMS Galaxy instances use individual system disks, you need to perform this action for each instance.
If you change the example program, compile and link it as follows:
$ CC GCU$BALANCER.C+SYS$LIBRARY:SYS$LIB_C/LIBRARY $ LINK/SYSEXE GCU$BALANCER
Startup Options ![]()
You must establish
a DCL command for this program. HP has provided a sample command
table file for this purpose. To install the new command, enter the
following:
$ SET COMMAND/TABLE=SYS$LIBRARY:DCLTABLES - _$ /OUT=SYS$COMMON:[SYSLIB]DCLTABLES GCU$BALANCER.CLDThis command inserts the new command definition into DCLTABLES.EXE in your common system directory. The new command tables take effect when the system is rebooted. If you would like to avoid a reboot, enter the following:
$ INSTALL REPLACE SYS$COMMON:[SYSLIB]DCLTABLES.EXEAfter this command, you need to log out and log back in to use the command from any active processes. Alternatively, if you would like to avoid logging out, enter the following from each process you would like to run the balancer from:
$ SET COMMAND GCU$BALANCER.CLDOnce your command has been established, you may use the various command-line parameters to control the balancer algorithm.
$ CONFIGURE BALANCER[/STATISTICS] x y timeIn this command, x is the number of load samples to take, y is the number of queued processes required to trigger resource reassignment, and time is the delta time between load sampling.
The /STATISTICS qualifier causes the program to display a continuous status line. This is useful for tuning the parameters. This output is not visible if the balancer is run detached, as is the case if it is invoked via the GCU. The /STATISTICS qualifier is intended to be used only when the balancer is invoked directly from DCL in a DECterm window. For example:
$ CONFIG BAL 3 1 00:00:05.00This starts the balancer, which samples the system load every 5 seconds. After three samples, if the instance has one or more processes in the COM queue, a resource (CPU) reassignment occurs, giving this instance another CPU.
|
|
|