HP HP-UX 11i Quick Reference Guide

Using HP-UX Workload Manager: A quick reference
Executive summary..........................................................................................................................3
HP-UX Workload Manager in action..................................................................................................4
Where is HP-UX Workload Manager installed?....................................................................................9
Can I see how HP-UX Workload Manager will perform without actually affecting my system?......................9
How do I start HP-UX Workload Manager?.......................................................................................10
How do I stop HP-UX Workload Manager?.......................................................................................10
How do I create a configuration file?............................................................................................... 11
What is the easiest way to configure HP-UX Workload Manager?.........................................................11
Where can I find example HP-UX Workload Manager configurations?...................................................12
How does HP-UX Workload Manager control applications? ................................................................. 12
How do I put an application under HP-UX Workload Manager control?.................................................13
Application records: Workload separation by binary name.............................................................. 14
User records: Workload separation by process owner..................................................................... 14
Unix group records: Workload separation by Unix group ID ............................................................15
Secure compartments: Workload separation by Secure Resource Partitions ......................................... 15
Process maps: Workload separation using your own criteria ............................................................15
prmrun: Starting a process in a workload group ...........................................................................16
prmmove: Moving an existing process to a workload group.............................................................16
Default: Inheriting workload group of parent process.......................................................................16
How do I determine a goal for my workload?.................................................................................... 17
What are some common HP-UX Workload Manager tasks?................................................................. 17
Migrating Cores across partitions ................................................................................................17
Providing a fixed amount of CPU resources ...................................................................................20
Portions of processors (FSS groups)........................................................................................... 21
Whole processors (pSets)........................................................................................................21
Providing CPU resources for a given time period ............................................................................22
Providing CPU resources as needed .............................................................................................24
What else can HP-UX Workload Manager do?..................................................................................27
Run in passive mode to verify operation........................................................................................27
Generate audit data..................................................................................................................27
Optimize the use of HP Temporary Instant Capacity........................................................................27
Integrate with various third-party products .....................................................................................27
What status information does HP-UX Workload Manager provide?....................................................... 28
How do I monitor HP-UX Workload Manager? ..................................................................................29
ps [-P] [-R workload_group].........................................................................................................29
wlminfo...................................................................................................................................29
wlmgui....................................................................................................................................30
prmmonitor.............................................................................................................................. 30
prmlist.....................................................................................................................................31
HP Glanceplus.......................................................................................................................... 31
wlm_watch.cgi CGI script........................................................................................................... 31
Status and message logs............................................................................................................ 32
Event Monitoring Service............................................................................................................32
For more information..................................................................................................................... 33
Executive summary
Traditional IT environments are often silos in which both technology and human resources are aligned around an application or business function. Capacity is fixed, resources are over-provisioned to meet peak demand, and systems are complex and difficult to change. Costs are based on owning and operating the entire vertical infrastructure—even when it is being underutilized.
Resource optimization is one of the goals of the HP Adaptive Enterprise strategy—a strategy for helping customers synchronize business and IT to adapt to and capitalize on change. To help you realize the promise of becoming an Adaptive Enterprise, HP provides virtualization technologies that pool and share resources to optimize utilization and meet demands automatically.
HP-UX Workload Manager (WLM) is a virtualization solution that helps you achieve a true Adaptive Enterprise. As a goal-based policy engine in the HP Virtual Server Environment, WLM integrates virtualization techniques—including partitioning, resource management, utility pricing resources, and clustering—and links them to your service level objectives (SLOs) and business priorities. WLM enables a virtual HP-UX server to grow and shrink automatically, based on the demands and SLOs for each application it hosts. You can consolidate multiple applications onto a single server to receive greater return on your IT investment while ensuring that end-users receive the service and performance they expect.
WLM automates many of the features of the Process Resource Manager (PRM) and HP-UX Virtual Partitions (vPars). WLM manages CPU resources within a single HP-UX instance as well as within and across hard partitions and virtual partitions. It automatically adapts system or partition CPU resources (cores) to the demands, SLOs, and priorities of the running applications. (A core is the actual data processing engine within a processor, where a single processor can have multiple cores.) On systems with HP Instant Capacity, WLM automatically moves cores among partitions based on the SLOs in the partitions. Given the physical nature of hard partitions, the “movement” of cores among partitions is achieved by deactivating a core on one nPartition and then activating a core on another.
This paper presents an overview of the techniques and tools available for using WLM A.03.02 and WLM A.03.02.02. WLM A.03.02 is available with the following operating system and hardware combinations:
Operating Systems Hardware
HP-UX 11i v1 (B.11.11) HP 9000 servers
HP-UX 11i v2 (B.11.23) HP Integrity servers and HP 9000 servers
HP-UX 11i v1 (B.11.11) and HP-UX 11i v2 (B.11.23)
WLM A.03.02.02 is available with the following operating system and hardware combinations:
Operating Systems Hardware
HP-UX 11i v3 (B.11.31) HP 9000 servers and HP Integrity servers
(Some of the functionality presented in this paper was available starting with WLM A.02.00.)
This paper assumes you have a basic understanding of WLM terminology and concepts, as well as WLM configuration file syntax. The paper first gives an overview of a WLM session. Then, it provides
Servers combining HP 9000 partitions and HP Integrity partitions (in such environments, HP-UX 11i v1 supports HP 9000 partitions only)
3
background information on various ways to use WLM, including how to complete several common WLM tasks. Lastly, it discusses how to monitor WLM and its effects on your workloads.
If you prefer to configure WLM using a graphical wizard, see the white paper, “Getting started with HP-UX Workload Manager,” available from the information library at:
http://www.hp.com/go/wlm
HP-UX Workload Manager in action
This section provides a quick overview of various commands associated with using WLM. It takes advantage of some of the configuration files and scripts that are used in the chapter “Learning WLM by example” in the HP-UX Workload Manager User’s Guide. These files are in the directory /opt/wlm/examples/userguide/ and at:
http://www.hp.com/go/wlm
To become familiar with WLM, how it works, and some related commands:
1. Log in as root.
2. Start WLM with an example configuration file:
# /opt/wlm/bin/wlmd –a \ /opt/wlm/examples/userguide/multiple_groups.wlm
The file multiple_groups.wlm is shown in the following. This configuration: – Defines two workload groups: g2 and g3. – Assigns applications (in this case, perl programs) to the groups. (With shell/perl programs, give
the full path of the shell or perl followed by the name of the program.) The two programs loop2.pl and loop3.pl are copies of loop.pl. The loop.pl script (available in /opt/wlm/examples/userguide) runs an infinite outer loop, maintains a counter in the inner loop, and shows the time spent counting.
– Sets bounds on usage of CPU resources . The number of CPU shares for the workload groups can
never go below the gmincpu or above the gmaxcpu values. These values take precedence over
the minimum and maximum values that you can optionally set in the slo structures. – Defines an SLO for g2. The SLO is priority 1 and requests 15 CPU shares for g2. – Defines a priority 1 SLO for g3 that requests 20 CPU shares.
4
# Name: # multiple_groups.wlm # # Version information: # # $Revision: 1.10 $ # # Dependencies: # This example was designed to run with HP-UX WLM version A.01.02 # or later. It uses the cpushares keyword introduced in A.01.02 # and is, consequently, incompatible with earlier versions of # HP-UX WLM. # # Requirements: # To ensure WLM places the perl scripts below in their assigned # workload groups, add "/opt/perl/bin/perl" (without the quotes) to # the file /opt/prm/shells.
prm {
groups = g2 : 2,
g3 : 3;
apps = g2 : /opt/perl/bin/perl loop2.pl,
g3 : /opt/perl/bin/perl loop3.pl;
gmincpu = g2 : 5, g3 : 5;
gmaxcpu = g2 : 30, g3 : 60;
}
slo test2 {
pri = 1; cpushares = 15 total; entity = PRM group g2;
}
slo test3 {
pri = 1; cpushares = 20 total; entity = PRM group g3;
}
5
3. Note what messages a WLM startup produces. Start another session to view the WLM message
log:
# tail -f /var/opt/wlm/msglog
08/29/06 08:35:23 [I] (p6128) wlmd initial command line: 08/29/06 08:35:23 [I] (p6128) argv[0]=/opt/wlm/bin/wlmd 08/29/06 08:35:23 [I] (p6128) argv[1]=-a 08/29/06 08:35:23 [I] (p6128) argv[2]=/opt/wlm/examples/userguide/multiple_gro ups.wlm 08/29/06 08:35:23 [I] (p6128) what: @(#)HP-UX WLM A.03.02 (2006_08_21_17_04_11) hpux_11.00 08/29/06 08:35:23 [I] (p6128) dir: @(#) /opt/wlm 08/29/06 08:35:23 [I] (p6128) SLO file path: /opt/wlm/examples/userguide/multipl e_groups.wlm 08/29/06 08:35:26 [I] (p6128) wlmd 6128 starting
The text in the log shows when the WLM daemon wlmd started, as well as what arguments it was started with—including the configuration file used.
4. Check that the workload groups are in effect.
The prmlist command shows current configuration information. This HP Process Resource Manager (PRM) command is available because WLM uses PRM to provide some of the WLM functionality. For more information on the prmlist command, see the “prmlist” section on page 31.
# /opt/prm/bin/prmlist
PRM configured from file: /var/opt/wlm/tmp/wmprmBAAa06335 File last modified: Thu Aug 29 08:35:23 2006
PRM Group PRMID CPU Upper LCPU
Entitlement Bound Attr
---------------------------------------------------------------­OTHERS 1 65.00% g2 2 15.00% g3 3 20.00%
PRM User Initial Group Alternate Group(s)
-------------------------------------------------------------------------------­root (PRM_SYS)
PRM Application Assigned Group Alternate Name(s)
-------------------------------------------------------------------------------­/opt/perl/bin/perl g2 loop2.pl /opt/perl/bin/perl g3 loop3.pl
A Web interface to the prmlist command is available. For information, see the wlm_watch(1M) manpage.
6
In addition, you can use the wlminfo command, which shows CPU Shares and utilization (CPU Util) for each workload group, and beginning with WLM A.03.02, the command also shows memory utilization (because memory records are not being managed for any of the groups in this example, a “-“ is displayed in the Mem Shares and Mem Util columns):
# /opt/wlm/bin/wlminfo group
Thu Aug 29 08:36:38 2006
Workload Group PRMID CPU Shares CPU Util Mem Shares Mem Util State OTHERS 1 65.00 0.00 - - ON g2 2 15.00 0.00 - - ON g3 3 20.00 0.00 - - ON
5. Start the scripts referenced in the configuration file, as explained in the following:
a. WLM checks the files /etc/shells and /opt/prm/shells to ensure one of them lists each shell
or interpreter, including perl, used in a script. If the shell or interpreter is not in either of those files, WLM ignores its application record (the workload group assignment in an apps statement).
Add the following line to the file /opt/prm/shells so that the application manager can correctly assign the perl programs to workload groups:
/opt/perl/bin/perl
b. Start the two scripts loop2.pl and loop3.pl. The following scripts produce output, so you
might want to start them in a new window.
# /opt/wlm/examples/userguide/loop2.pl & # /opt/wlm/examples/userguide/loop3.pl &
These scripts start in the PRM_SYS group because you started them as the root user. However, the application manager soon moves them (within 30 seconds) to their assigned groups, g2 and g3. After waiting 30 seconds, run the following ps command to see that the processes have been moved to their assigned workload groups:
# ps -efP | grep loop
The output will include the following items (column headings are included for convenience):
PRMID PID TTY TIME COMMAND
g3 6463 ttyp1 1:42 loop3.pl g2 6462 ttyp1 1:21 loop2.pl
6. Manage workload group assignments:
a. Start a process in the group g2:
# /opt/prm/bin/prmrun -g g2 \ /opt/wlm/examples/userguide/loop.pl
b. Verify that loop.pl is in g2 with ps:
# ps -efP | grep loop
The output will confirm the group assignment:
g2 6793 ttyp1 0:02 loop.pl
7
c. Move the process to another group.
Use the process ID (PID) for loop.pl from the last step to move loop.pl to the group g3:
# /opt/prm/bin/prmmove g3 -p loop.pl_PID
In this case, loop.pl_PID is 6793.
7. Verify workload group assignments:
The ps command has two options related to WLM:
-P shows PRM IDs (workload group IDs) for each process.
-R workload_group shows ps listing for only the processes in workload_group.
Looking at all the processes, the output includes the following items (column headings are included for convenience):
# ps -efP | grep loop
PRMID PID TTY TIME COMMAND
g3 6793 ttyp1 1:52 loop.pl g3 6463 ttyp1 7:02 loop3.pl g2 6462 ttyp1 4:34 loop2.pl
Focusing on the group g3, the output is: # ps -R g3
PID TTY TIME COMMAND 6793 ttyp1 1:29 loop.pl 6463 ttyp1 6:41 loop3.pl
8. Check usage of CPU resources:
The wlminfo command shows usage of CPU resources (CPU utilization) by workload group. The command output, which might be slightly different on your system, follows:
# /opt/wlm/bin/wlminfo group
Workload Group PRMID CPU Shares CPU Util Mem Shares Mem Util State OTHERS 1 65.00 0.00 - - ON g2 2 15.00 14.26 - - ON g3 3 20.00 19.00 - - ON
This output shows that both groups are using CPU resources up to their allocations. If the allocations were increased, the groups’ usage would probably increase to match the new allocations.
9. Stop WLM:
# /opt/wlm/bin/wlmd -k
8
10. Note what messages a WLM shutdown produces:
Run the tail command again:
# tail -f /var/opt/wlm/msglog
You will see messages similar to the following:
08/29/06 09:06:55 [I] (p6128) wlmd 6128 shutting down 08/29/06 09:06:55 [I] (p7235) wlmd terminated (by request)
11. Stop the loop.pl, loop2.pl, and loop3.pl perl programs.
Where is HP-UX Workload Manager installed?
The following table shows where WLM and some of its components are installed.
Item Installation path
WLM /opt/wlm/ WLM Toolkits /opt/wlm/toolkits/ Manpages for WLM and its toolkits /opt/wlm/share/man/
If you are using WLM configurations that are based on the Process Resource Manager (PRM) product, you must install PRM.
Can I see how HP-UX Workload Manager will perform without actually affecting my system?
WLM provides a passive mode that enables you to see approximately how WLM will respond to a given configuration—without putting WLM in charge of your system resources. Using this mode, enabled with the -p option to wlmd, you can gain a better understanding of how various WLM features work. In addition, you can verify that your configuration behaves as expected—with minimal effect on the system. For example, with passive mode, you can answer the following questions:
How does a cpushares statement work?
How do goals work? Is my goal set up correctly?
How might a particular cntl_convergence_rate value or the values of other tunables affect
allocation change?
How does a usage goal work?
Is my global configuration file set up as I wanted? If I used global arbitration on my production
system, what might happen to the CPU layouts?
Is a user’s default workload set up as I expected?
Can a user access a particular workload?
When an application is run, which workload does it run in?
Can I run an application in a particular workload?
Are the alternate names for an application set up correctly?
For more information on how to use the passive mode of WLM, as well as explanations of how passive mode does not always represent actual WLM operations, see the “PASSIVE MODE VERSUS ACTUAL WLM MANAGEMENT” section in the wlm(5) manpage.
9
Activate a configuration in passive mode by logging in as root and running the command:
# /opt/wlm/bin/wlmd -p -a config.wlm
where config.wlm is the name of your configuration file. The WLM global arbiter, wlmpard, which is used in managing SLOs across virtual partitions and
nPartitions, also provides a passive mode.
How do I start HP-UX Workload Manager?
Before starting WLM (activating a configuration), you might want to try the configuration in passive mode, discussed in the previous section. Otherwise, you can activate your configuration by logging in as root and running the following command:
# /opt/wlm/bin/wlmd -a config.wlm
where config.wlm is the name of your configuration file. When you run the wlmd -a command, WLM starts the data collectors you specify in the WLM
configuration. Although data collectors are not necessary in every case, be sure to monitor any data collectors you
do have. Because data collection is a critical link for effectively maintaining your configured SLOs, you must be aware when a collector exits unexpectedly. One method for monitoring collectors is to use wlminfo slo.
For information on creating your WLM configuration, see the “How do I create a configuration file?“ section on page 11.
WLM automatically logs informational messages to the file /var/opt/wlm/msglog. In addition, WLM can log data that enables you to verify WLM management and fine-tune your WLM configuration file. To log this data, use the -l option. This option causes WLM to log data to /var/opt/wlm/wlmdstats. The following command line starts WLM, logging data for SLOs every third WLM interval:
# /opt/wlm/bin/wlmd -a config.wlm -l slo=3
For more information on the -l option, see the wlmd(1M) manpage.
How do I stop HP-UX Workload Manager?
With WLM running, stop it by logging in as root and running the command:
# /opt/wlm/bin/wlmd -k
10
Loading...
+ 23 hidden pages