Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Workload Manager User's Guide: Version A.03.02.02 > Chapter 2 WLM quick start: the essentials for using WLM

WLM shown in action

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

This section provides a quick overview of various commands associated with using WLM in a PRM-based configuration (using FSS or PSET-based workload groups and confined to a single instance of HP-UX). For information on using WLM in host-based configurations designed for moving cores across virtual partitions and nPartitions, see Chapter 7 “Managing SLOs across partitions”. To become familiar with how WLM moves cores across partitions, see the par_usage_goal.wlm and par_usage_goal.wlmpar configuration files in /opt/wlm/examples/wlmconf/ and also included in Chapter 9 “Example configuration files”. The files includes steps to take for implementing migration across partitions.

This chapter takes advantage of some of the configuration files and scripts available in the directory /opt/wlm/examples/userguide/ as well as at the following Web site:

http://www.hp.com/go/wlm

NOTE: You can define FSS or PSET-based workload groups and use WLM partition management in the same WLM configuration. Certain software restrictions apply to using PSET-based groups with virtual partitions (vPars), Instant Capacity, and Pay per use. For more information, see the WLM Release Notes (/opt/wlm/share/doc/Rel_Notes). On HP-UX 11i v1 (B.11.11) systems, you must install PSET (PROCSET) software to obtain PSET functionality; see the HP-UX WLM Release Notes. PSET functionality comes with HP-UX 11i v2 (B.11.23) and HP-UX 11i v3 (B.11.31) systems.

To become familiar with WLM, how it works in PRM-based configurations, and some related commands, complete the following procedure:

NOTE: For this procedure to work, PRM must be installed on your system.
  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 example configuration file is multiple_groups.wlm, which does the following:

    1. Defines two workload groups: g2 and g3.

    2. 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, counts in the inner loop, and shows the time spent counting:

      #!/opt/perl/bin/perl -w
      #
      # Name:
      # loop.pl
      #
      # Version information:
      #
      # $Revision: 1.4 $

      $maxcount = 3000000;

      # Here is an infinite loop
      while (1) {
      $count = 1;
      $start = time();
      while ($count <= $maxcount) {
      $count++;
      }
      $end = time();
      printf (“loop.pl: Elapsed time=%.2f seconds\n”, $end-$start);
      }
    3. Sets bounds on CPU usage. 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.

    4. Defines an SLO (service-level objective) for g2. The SLO is priority 1 and requests 15 CPU shares for g2.

    5. Defines a priority 1 SLO for g3 that requests 20 CPU shares.

  3. See 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. See that the workload groups are in effect.

    The prmlist command shows current configuration information, as in the following example. (This PRM, or Process Resource Manager, command is available because WLM uses PRM to provide some of the WLM functionality. For more information about the prmlist command, see “prmlist”.)

    # /opt/prm/bin/prmlist

    PRM configured from file:  /var/opt/wlm/tmp/wmprmBAAa06335
    File last modified: Thu Aug 24 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

    Starting with WLM A.02.00, a web interface to the prmlist command is available. For information, see wlm_watch(1M).

    In addition, you can use the wlminfo command, which shows CPU Shares and utilization (CPU Util) for each workload group, and starting with WLM A.03.02, also shows the memory utilization, as in the following example (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 Jun 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.

    1. 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

    2. The following two scripts produce output, so you may want to start them in a new window. Start the two scripts loop2.pl and loop3.pl as follows:

      # /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:

    1. Start a process in the group g2:

      # /opt/prm/bin/prmrun -g g2 /opt/wlm/examples/userguide/loop.pl

    2. Verify that loop.pl is in g2 with the ps command:

      # ps -efP | grep loop

      The output will confirm the group assignment:

      g2 6793 ttyp1 0:02 loop.pl

    3. Move the process to another group.

      Use the 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:

    For verifying 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, we get output including the items shown in the following example (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, we get the following output:

    # ps -R g3

        PID TTY       TIME COMMAND
    6793 ttyp1 1:29 loop.pl
    6463 ttyp1 6:41 loop3.pl
  8. Check CPU usage.

    The wlminfo command shows CPU usage (utilization) by workload group. The command’s output, which may be slightly different on your system, is shown in the following example.

    # /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 (cores) 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

  10. See what messages a WLM shutdown produces:

    Running the tail command again, you will see messages similar to those shown in the following example:

    # tail -f /var/opt/wlm/msglog

    08/29/02 09:06:55 [I] (p6128) wlmd 6128 shutting down
    08/29/02 09:06:55 [I] (p7235) wlmd terminated (by request)
  11. Stop the loop.pl, loop2.pl, and loop3.pl perl programs.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2000-2007 Hewlett-Packard Development Company, L.P.