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?....................................................................................
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 ..................................................................
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.
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.
# # # # # # # # # # # # # # # # # 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.
Note what messages a WLM startup produces. Start another session to view the WLM message log: 3. # 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.
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 5. PRMID CPU Shares CPU Util Mem Shares Mem Util State OTHERS 1 65.00 0.
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.
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.
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.
How do I create a configuration file? The WLM configuration file is simply a text file. To create your own WLM configuration file, use one or more of the following techniques: • Determine which example configurations can be useful in your environment, and modify them appropriately. For information on example configurations, see the “Where can I find example HP-UX Workload Manager configurations?” section on page 12.
Where can I find example HP-UX Workload Manager configurations? WLM and its toolkits come with example WLM configuration files. These files are located in the directories indicated in the table below.
NOTE WLM adjusts only a workload group’s CPU allocation in response to SLO performance. Thus, WLM SLO management is most effective for workloads that are CPU-bound. How do I put an application under HP-UX Workload Manager control? WLM can treat an nPartition or virtual partition as a workload. The workload consists of all the processes running in the operating system instance on the partition. WLM also enables you to divide the resources of a single operating system into pSets or FSS groups.
With the workload groups defined, the remainder of this section explores how processes can be placed in the workload groups. Application records: Workload separation by binary name One mechanism for separating workloads is the apps statement. This statement names a particular application binary and the group in which it should be placed. You can specify multiple binary-workload group combinations, separated by commas, in a single apps statement.
Unix group records: Workload separation by Unix group ID You can place processes in workload groups according to the Unix groups the processes run in. Specify your Unix group-workload group mapping in the uxgrp statement as in the following example: prm { groups = OTHERS : 1, testers : 2, coders : 3, surfers : 4; uxgrp = sports : surfers, shoes : coders, appliances : testers; } Besides the default OTHERS group, this example has the three workload groups testers, coders, and surfers.
place processes that you might otherwise have to move manually by using the prmmove or prmrun commands. In the prm structure that follows, the procmap statement causes the PRM application manager to place in the sales group any processes gathered by the ps command that have PIDs matching the application pid_app. The application manager places in the mrktg group any processes gathered by the external script pidsbyapp that have PIDs matching the application mrketpid_app.
How do I determine a goal for my workload? NOTE Be aware of the resource interaction for each of your workloads. Limiting a workload’s memory allocation can also limit its use of CPU resources. For example, if a workload uses memory and CPU resources (cores) in the ratio of 1:2, limiting the workload to 5% of the memory implies that it cannot use more than 10% of the CPU resources—even if it has a 20% CPU allocation.
You must use Instant Capacity cores (formerly known as iCOD CPUs) on the nPartitions for WLM management. (A core is the actual data processing engine within a processor; a processor can have multiple cores.) WLM provides a global arbiter, wlmpard, that can take input from the WLM instances on the individual partitions. The global arbiter then moves cores between partitions, if needed, to better achieve the SLOs specified in the WLM configuration files that are active in the partitions.
The wlmd daemon runs in secure mode by default when you use the /sbin/init.d/wlm script to start WLM. (If you upgraded WLM, secure mode might not be the default. Ensure that the appropriate secure mode variables in /etc/rc.config.d/wlm are set correctly. For more information on these variables, see the wlmcert(1M) manpage. 5. Create a configuration file for the global arbiter. On the system running the global arbiter, create a configuration file for the global arbiter.
start WLM. (If you upgraded WLM, secure mode might not be the default. Ensure that the appropriate secure mode variables in /etc/rc.config.d/wlm are set correctly. For more information on these variables, see the wlmcert(1M) manpage. Providing a fixed amount of CPU resources WLM enables you to give a workload group a fixed amount of CPU resources. The following figure shows a group with a fixed allocation of 15 CPU shares. Figure 1.
Within a single HP-UX instance, WLM enables you to allocate a fixed amount of CPU resources using: • Portions of processors (FSS groups) • Whole processors (pSets) You can also allocate a fixed amount of CPU resources to virtual partitions and nPartitions. HP recommends omitting from WLM management any partitions that should have a constant size. In such cases, WLM’s capability of migrating CPU resources is not needed.
NOTE PRM must be installed on your system for WLM to be able to manage workgroups based on PSETs. To place an application in a workload group based on a pSet: Define the workload group based on a pSet, and assign a workload to it. 1. In your WLM configuration file, define your workload group in a prm structure using the groups keyword. Assign a workload (application) to the group using the apps keyword. Use the gmincpu statement to set the minimum CPU usage.
Figure 2. Time-based resource allocation SLO is enabled SLO is disabled; workload gets its gmincpu To provide a workload group CPU resources based on a schedule: NOTE This procedure applies only to PRM-based configurations (confined within a single instance of HP-UX). PRM must be installed on your system for WLM to be able to manage PRM-based workloads. You can achieve similar functionality for configurations that manage partitions by using a condition keyword similar to the one shown in step 2.
Define the SLO. 2. The SLO in your WLM configuration file must specify a priority (pri) for the SLO, the workload group to which the SLO applies (entity), and either a cpushares statement or a goal statement so that WLM grants the SLO’s workload group some CPU resources. The condition keyword determines when the SLO is enabled or disabled. The following slo structure shows a fixed-allocation SLO for the sales group. When enabled, this SLO requests 25 CPU shares for the sales group.
Figure 3. CPU usage goal Here, WLM adjusts the allocation so that the workload always uses at least 60% but never more than 90% of it With a usage goal, you indicate for a workload how much of its CPU allocation it should use. The workload’s CPU allocation is then reduced if not enough of its current allocation is being consumed, allowing other workloads to consume more CPU resources if needed. Similarly, if the workload is using a high percentage of its allocation, it is granted more CPU resources.
Define the SLO. 2. The SLO in your WLM configuration file must specify a priority (pri) for the SLO, the workload group to which the SLO applies (entity), and a usage goal statement. The following slo structure for the sales group shows a usage goal statement.
What else can HP-UX Workload Manager do? Run in passive mode to verify operation WLM provides a passive mode that enables you to see how WLM will approximately respond to a given configuration without putting WLM in charge of your system resources. Using this mode, you can verify that your configuration behaves as expected—with minimal effect on the system. Besides being useful in understanding and experimenting with WLM, passive mode can be helpful in capacity-planning activities.
What status information does HP-UX Workload Manager provide? WLM has three log files to keep you informed: • /var/opt/wlm/msglog WLM prints errors and warnings about configuration file syntax on stderr. For messages about on-going WLM operations, WLM logs error and informational messages to /var/opt/wlm/msglog, as shown in the following example: 05/07/06 14:12:44 [I] (p13931) Ready to forward data for metric "m_apache_access_2min" 05/07/06 14:12:44 [I] (p13931) Using "/door00/wlm_cfg/apache_access.
How do I monitor HP-UX Workload Manager? There are several methods for monitoring WLM, as described in the following sections. ps [-P] [-R workload_group] The ps command has options that are specific to PRM, which WLM uses to define workload groups when dividing resources within a single HP-UX instance: •-P This option adds the column PRMID, showing the workload group for each process. # ps -P PRMID PID TTY TIME COMMAND g3 6793 ttyp1 1:52 loop.pl g3 6463 ttyp1 7:02 loop3.
The following example shows host information: Hostname Cores Cores Used Interval 7 0.03 6 localhost wlmgui The wlmgui command, available in /opt/wlm/bin/, graphically displays information about SLOs, metrics, workload groups, partitions, and the current host. The following figure shows graphical information about the CPU shares allocation and CPU usage for the workload SalesGrp. Figure 4.
PRM configured from file: /var/opt/wlm/tmp/wmprmBAAa06335 File last modified: Thu Aug 29 08:35:23 2006 HP-UX shed B.11.23 U 9000/800 Thu Aug 29 08:43:16 2006 CPU scheduler state: 08/29/06 Sample: 1 second Enabled, CPU cap ON PRM Group PRMID CPU Upper CPU LCPU Entitle Bound Used State ____________________________________________________________________ OTHERS 1 65.00% 0.00% g2 2 15.00% 0.00% g3 3 20.00% 0.
Status and message logs WLM provides the following logs: • /var/opt/wlm/msglog • /var/opt/wlm/wlmdstats • /var/opt/wlm/wlmpardstats For information on these logs, including sample output, see the “What status information does HP-UX Workload Manager provide?” section on page 28. Event Monitoring Service Event Monitoring Service (EMS) polls various system resources and sends messages when events occur. The WLM wlmemsmon command provides numerous resources for event monitoring.
For more information For more information on HP-UX Workload Manager, contact any HP worldwide sales offices or see the HP website at: http://www.hp.com/go/wlm To learn more about the Adaptive Enterprise and virtualization, see: http://www.hp.com/go/virtualization The following references provide useful background information on related products and topics: • HP-UX Workload Manager (HP-UX WLM)—http://www.hp.com/go/wlm • HP-UX Workload Manager User’s Guide—http://www.docs.hp.