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.
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:
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.
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.
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:
cd /etc/wlm/MyConfig
vi groupings
trusted = user[0-9][0-9], admin* nottrusted = user23, user45 shell = /bin/?sh, \ /bin/sh, \ /bin/tcsh rootgroup=system,bin,sys,security,cron,audit
*class resvd user group application type tag classA - $trusted,!$nottrusted - - - - classB - - - $shell,!/bin/zsh - - classC - - $rootgroup - - -
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.
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:
mkdir /etc/wlm/MyConfigSet cd /etc/wlm/MyConfigSet
ConfigurationName: time = "N-N,HH:MM-HH:MM"or
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"
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
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.
lsrset -avThe 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.00000In 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.
smit addrsetcntlFor this example, fill in the fields as follows:
smit reloadrsetcntlThis 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.)
smit wlmclass_galSelect 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.
smit wlmupdate
smit wlmstart
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.
smit lsrsetprocEnter 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.