[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

System Management Guide:
Operating System and Devices

Workload Manager Configuration Tasks

Workload Manager is part of the base operating system and is installed with the base operating system, but it is an optional service. It must be configured to suit your system environment, started when you want to use it, and stopped when you want to suspend or end WLM service.

This section provides instructions for the following configuration tasks:

Instructions for creating an example WLM configuration are in Configure Workload Manager (WLM) to Consolidate Workloads.

Starting and Stopping WLM

WLM is an optional service that must be started and stopped. It is recommended that you use one of the system management interfaces, Web-based System Manager or SMIT, to start or stop WLM.

The key difference between these options is permanence. In Web-based System Manager or SMIT, you can start or stop WLM three ways:

current session
If you request to stop WLM with this option, WLM will be stopped for this session only and restarted at next reboot. If you request a start with this option, WLM will be started for this session only and not restarted at next reboot.
next reboot
If you request to stop WLM with this option, WLM will remain running for this session only and will not be restarted at next reboot. If you request a start with this option, WLM will not be available for this session, but will be started at next reboot.
both
If you request to stop WLM with this option, WLM will be stopped for this session only and will not be restarted at next reboot. If you request a start with this option, WLM will be started for this session only and will be restarted at next reboot.

You can also use the wlmcntrl command, but the wlmcntrl command allows you to start or stop WLM for the current session only. If you want to use the command line interface and you want the change to remain in effect when the machine is rebooted, you must edit the /etc/inittab file.

WLM can be used to regulate resource consumption as per-class percentages, per-class totals, or per-process totals. Regulation for all resource types can be enabled by running WLM in active mode. Optionally, you can start a mode of WLM that classifies new and existing processes and monitors the resource usage of the various classes, without attempting to regulate this usage. This mode is called the passive mode. If CPU time is the only resource that you are interested in regulating, you can choose to run WLM in active mode for CPU and passive mode for all other resources. This mode is called cpu only mode.

All processes existing in the system before WLM is started are classified according to the newly loaded assignment rules, and are monitored by WLM.

Specifying WLM Properties

You can specify the properties for the WLM configuration by using the Web-based System Manager, SMIT, the WLM command line interface, or by creating flat ASCII files. The Web-based System Manager and SMIT interfaces use the WLM commands to record the information in the same flat ASCII files, called property files.

A set of WLM property files defines a WLM configuration. You can create multiple sets of property files, defining different configurations of workload management. These configurations are located in subdirectories of /etc/wlm. The WLM property files describing the superclasses of the Config configuration are the file's classes, description, limits, shares and rules in /etc/wlm/Config. Then, the property file's describing the subclasses of the superclass Super of this configuration are the file's classes, limits, shares and rules in directory /etc/wlm/Config/Super. Only the root user can start or stop WLM, or switch from one configuration to another.

The property files are named as follows:

classes Class definitions
description Configuration description text
groupings Attribute value groupings
limits Class limits
shares Class target shares
rules Class assignment rules

The command to submit the WLM property files, wlmcntrl, and the other WLM commands allow users to specify an alternate directory name for the WLM properties files. This allows you to change the WLM properties without altering the default WLM property files.

A symbolic link, /etc/wlm/current, points to the directory containing the current configuration files. Update this link with the wlmcntrl command when you start WLM with a specified configuration or configuration set. The sample configuration files shipped with the operating system are in /etc/wlm/standard.

Creating an Attribute Value Grouping

You can group attribute values and represent them with a single value in the rules file. Theseattribute value grouping are defined in a groupings file within the WLM configuration directory.

By default, a configuration has no groupings file. There is no command or management interface to create one. To create and use attribute value groupings, use the following procedure:

  1. With root authority, change to the appropriate configuration directory, as shown in the following example:
    cd /etc/wlm/MyConfig
  2. Use your favorite editor to create and edit a file named groupings. For example:
    vi groupings
  3. Define attributes and their associated values using the following format:
    attribute = value, value, ...
    All values must be separated by commas. Spaces are not significant. Ranges and wild cards are allowed. For example:
    trusted = user[0-9][0-9], admin*
    nottrusted = user23, user45
    shell = /bin/?sh, \
            /bin/sh, \
            /bin/tcsh
    rootgroup=system,bin,sys,security,cron,audit
  4. Save the file.
  5. To use attribute groupings within the selection criteria for a class, edit the rules file. The attribute grouping name must be preceded by a dollar sign ($) to include the corresponding values or the exclamation point (!) to exclude the values. The exclamation point cannot be used in the members of the group (step 3), and it is the only modifier that can be used in front of the grouping in this rules file. In the following example, the asterisk (*) signals a comment line:
    *class  resvd  user                  group       application       type  tag
    classA  -      $trusted,!$nottrusted  -           -                 -     -
    classB  -      -                     -           $shell,!/bin/zsh  -     -
    classC  -      -                     $rootgroup  -                 -     -
  6. Save the file.

At this point, your classification rules includes attribute value groupings. When the rules are parsed, if an element beings with a $, the system looks for that element within the groupings file. If an element is syntactically invalid or if the groupings file does not exist, the system displays a warning message and continues processing other rules.

Creating a Time-Based Configuration Set

You can create a set of specialty configurations and assign each configuration within the set to days and times when you want a specific configuration to be in effect. These sets, called time-based configuration sets, are completely separate from but compatible with your normal configuration. You can use the wlmcntrl -u command to switch between a configuration set and your normal configuration as needed.

When using a configuration set, you associate existing named configurations, typically with a specific time range. Because only one configuration can be used at any given time, each specified time range must be unique; time ranges cannot overlap or be duplicated.

The wlmd daemon alerts WLM when a specified configuration goes out of time range and another configuration needs to be used. Only the root user can manage these time ranges, which are specified within the configuration set's directory in an ASCII file called .times.

Use the following procedure to create a time-based configuration set:

  1. With root authority, create a configuration set directory then change to that directory. For example:
    mkdir /etc/wlm/MyConfigSet
    cd /etc/wlm/MyConfigSet
  2. Use your favorite editor to create the configuration set's .times file and specify the configuration and time ranges in the following format:
    ConfigurationName:
                time = "N-N,HH:MM-HH:MM"
    or
    ConfigurationName:
    time = -
    (no time value specified)
    Where N is a numeral representing a day of the week in the range of 0 (Sunday) through 6 (Saturday), HH represents the hour in the range of 00 (midnight) to 23 (11 p.m.), and MM represents the minutes in the range of 00 to 59. You can specify the day only or not at all. An hour value of 24 is valid for the ending hour of the day, provided that the minute value is 00. If you type a dash (-) instead of a time range for a particular configuration, that configuration will be used when the other configurations' time ranges are not in effect. Only one configuration can be specified without a time range.

    For example:

    conf1:
        time = 
    conf2: 
        time = "1-5,8:00-17:00"
    conf2
        time = "6-0,14:00-17:00"
    conf3
        time = "22:00-6:00"
  3. Use the wlmcntrl -u command to update WLM with the new configuration set. For example:
    wlmcntrl -u /etc/wlm/MyConfigSet

At this point, WLM's current configuration is your new time-based configuration set.

You can also use the confsetcntrl and lswlmconf commands to create and manipulate configuration sets. For example:

To create the confset1 configuration set with a default configuration of conf1, use the following command:

confsetcntrl -C confset1 conf1

To add conf2 to confset1 and make it the active configuration from 8:00 AM to 5:00 PM daily, use the following command:

confsetcntrl -d confset1 -a conf2 "0-6,08:00-17:00"

To make this configuration set the active configuration, use the following command:

wlmcntrl -d confset1

Creating a Resource Set

Using resource sets (rsets) is an effective way to isolate workloads from one another as far as the CPU is concerned. By separating two different workloads into two classes and giving each class a different subset of the CPUs, you can make sure that the two workloads never compete with each other for CPU resources, even though they still compete for physical memory and I/O bandwidth.

The simplest way to create a resource set is to use the SMIT interface (smit addrsetcntl fast path) or the mkrset command.

For instructional purposes, the following example illustrates each step of creating and naming a resource set on a 4-way system. Its goal is to create a resource set containing processors 0 to 2, and use it in WLM configuration to restrict all processes of a superclass to these three processors.

  1. With root authority, view the available building blocks (from which to create the resource sets) using the following command:
    lsrset -av
    The output for this example is the following:
    T  Name               Owner   Group   Mode    CPU  Memory  Resources    
    r  sys/sys0           root    system  r-----    4   98298  sys/sys0     
    r  sys/node.00000     root    system  r-----    4   98298  sys/sys0     
    r  sys/mem.00000      root    system  r-----    0   98298  sys/mem.00000
    r  sys/cpu.00003      root    system  r-----    1       0  sys/cpu.00003
    r  sys/cpu.00002      root    system  r-----    1       0  sys/cpu.00002
    r  sys/cpu.00001      root    system  r-----    1       0  sys/cpu.00001
    r  sys/cpu.00000      root    system  r-----    1       0  sys/cpu.00000
    In the output, sys/sys0 represents the whole system (in this case, a 4-way SMP). When a WLM class does not specify an rset attribute, this is the default set that its processes potentially can access.
  2. Create and name the resource set using the following SMIT fast path:
    smit addrsetcntl
    For this example, fill in the fields as follows:
    Name Space
    admin
    Resource Set Name
    proc0_2
    Resources
    Select from the list those lines that correspond to the memory and CPUs 0 to 2 (sys/cpu.00000 to sys.cpu.00002).
    All other fields
    Select from the lists.
    When you finish entering the fields and exit SMIT, the admin/proc0_2 rset is created in /etc/rsets.
  3. To use the new rset, add it into the kernel data structures using the following SMIT fast path:
    smit reloadrsetcntl
    This menu gives you the option to reload the data base now, at next boot or both. Because this is the first time you are using the new resource set, select both so that this rset will be loaded now and after each reboot. (If you had changed an existing rset, you would probably have selected now.)
  4. Add the new rset to a WLM class using the following SMIT fast path:
    smit wlmclass_gal
    Select the class (in this example, super1) then select admin/proc0_2 from the list available for the Resource Set field. After you make your selection and exit SMIT, the classes file on disk is changed.
  5. Do one of the following:
  6. Monitor the effect of the new resource set on the class. For example:
    1. Start 90 CPU loops (program executing an infinite loop) in class super1.
    2. Type wlmstat on the command line. The output for this example is the following:

                     CLASS CPU MEM BIO
              Unclassified   0   0   0
                 Unmanaged   0   0   0
                   Default   8   0   0
                    Shared   0   0   0
                    System   0   0   0
                    super1  75   0   0
                    super2   0   0   0
          super2.Default     0   0   0
           super2.Shared     0   0   0
             super2.sub1     0   0   0
             super2.sub2     0   0   0

      This output shows that the 90 CPU bound processes, which otherwise unconstrained would take up 100% of the CPU, now use only 75% because the resource set limits them to run on CPUs 0 to 2.

    3. To verify what resource set a process (identified by its PID) has access to, use the following SMIT fast path:
      smit lsrsetproc
      Enter the PID of the process you are interested in or select it from the list. The following output is for one of the loop processes:

          CPU  Memory  Resources
            3   98298  sys/mem.00000 sys/cpu.00002 sys/cpu.00001 sys/cpu.00000

      Compare this with a process from a class without a specified rset attribute. (When no rset is specified for a class, it uses the Default resource set.) The following output is from the init process, which is in a class that does not specify a resource set:

          CPU  Memory  Resources
            4   98298  sys/sys0

At this point, your resource set exists and is being used by at least one class within WLM. For additional information see the lsrset command description in the AIX 5L Version 5.2 Commands Reference.

Note
WLM will not set its rset attachment for a process that currently has a bindprocessor subroutine binding or another rset attachment. When the other attachment no longer exists, WLM will assign its rset automatically.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]