User Tools

Site Tools


aix:workloadmanager

This is an old revision of the document!


Worload Manager to limit processes

AIX wokload manager can be used to limit processes usage (CPU, IO, and memory)

processes are classified by user, process name, ….

Then rules are applied to each class

Some classes exists by default, but you can create additional, for example for DB2, Oracle….

WLM definitions are stored into /etc/wlm/, you can use smit wlm

root@prod /root> wlmcntrl -q
WLM is stopped

root@prod /root> wlmcntrl -a

root@prod /root> wlmcntrl -q
WLM is running

root@prod /root> wlmstat
         CLASS    CPU    MEM   DKIO
  Unclassified   0.00  20.54   0.00
     Unmanaged   0.00   9.04   0.00
       Default   2.25   4.38   0.00
        Shared   0.00   0.76   0.00
        System   1.12   2.41   0.35
         TOTAL   3.37  28.09   0.35

To monitor you can also use:

wlmstat 3 100
nmon (then option W)

Check your process class

root@prod /root> ps -ae -o pid,user,class,args
     PID     USER CLASS        COMMAND
       1     root Unclassified /etc/init
 2949328     root Unclassified /usr/sbin/syncd 60
 3211498     root Unclassified /usr/ccs/bin/shlap64
 3801296     root Unclassified /usr/lib/errdemon
 4653308     root Unclassified /usr/sbin/portmap
 4849858     root Unclassified /usr/sbin/snmpd
 7209188     root System       /usr/sbin/smbd -D
 7274732   nobody System       /usr/sbin/smbd -D
 7340260     root System       /opt/rsct/bin/rmcd -a IBM.LPCommands -r -S 1500
 7405804     root System       [trspoolm]
 7471338     root System       ./mflm_manager
 7602278      ek  Default      CONS3
 7667888      ew  Default      TH
 7733346      ek  Default      THC
 7798796     root System       /opt/rsct/bin/IBM.MgmtDomainRMd
 7864420     root System       /opt/rsct/bin/IBM.ServiceRMd
 7929868     root System       /opt/rsct/bin/IBM.HostRMd
Switch in WLM in to active mode. Active means monitor and possibly controlling class resource (if you assign shares):

wlmctrl -a
Alternatively, start in passive mode (monitor only and no possibility of changing the behavior):

wlmctrl -p
Create four new classes for RDBMS, Batch, Backup and remote user connection application:
A simple edit to the test file as the root user:  /etc/wlm/current/classes
Name the class and specify how AIX can decide which processes are in which class. A simple way is to name the AIX user that starts the workload programs. Alternatives, are using user groups or the directories that contain the binary program files. Once a process is in a class, the default setting is for all processes it creates are in the same class.

Tell AIX WLM to reevaluate ("u" for update) the classes file:
wlmcntrl -u


       -a
            Starts WLM in active mode or switches from passive to active mode. This is the default when no flag other than -d, -g, or -T is specified.
       -c
            Starts WLM in processor-only mode or switches from any mode to processor-only mode. In this mode, the WLM accounts for all resources, but only processor resource is regulated.
       -d Config_dir
            Uses /etc/wlm/Config_dir as an alternate directory for the WLM configuration (containing the classes, limits, shares and rules files) or configuration set (containing the list of configurations
            and the time tanges when they apply). This makes /etc/wlm/Config_dir the current configuration. This flag is effective when starting the WLM in active, processor-only or passive mode, or when
            updating the WLM. This flag cannot be used in conjunction with the -o and -q flags or when switching from a mode (among active, processor-only and passive) to another.
       -g
            Instructs WLM to ignore any potential resource set bindings. This means that all classes have access to the whole resource set of the system, regardless of whether or not they use a restricted
            resource set.

       -o
            Stops Workload Manager.
       -p
            Start WLM in passive mode or switches from any mode to passive mode. In this mode, the WLM accounts for all resources, but no resource is regulated.
       -q

List classes and limits class

root@prod /root> lsclass -C
#name:description:tier:inheritance:authuser:authgroup:adminuser:admingroup:rset:CPUshares:CPUmin:CPUsoftmax:CPUhardmax:memoryshares:memorymin:memorysoftmax:memoryhardmax:diskIOshares:diskIOmin:diskIOsoftmax:diskIOhardmax:totalCPUhardmax:totalCPUunit:totalDiskIOhardmax:totalDiskIOunit:totalConnecttimehardmax:totalConnecttimeunit:totalProcesseshardmax:totalThreadshardmax:totalLoginshardmax:classRealMem:classRealMemunit:classVirtMem:classVirtMemunit:classLargePages:classLargePagesunit:procVirtMem:procVirtMemunit:localshm:vmenforce:delshm:iopriority
System::0:no::::::-:0:100:100:-:1:100:100:-:0:100:100:-:s:-:KB:-:s:-:-:-:-:MB:-:MB:-:MB:-:MB:no:proc:no:0
Default::0:no::::::-:0:100:100:-:0:100:100:-:0:100:100:-:s:-:KB:-:s:-:-:-:-:MB:-:MB:-:MB:-:MB:no:proc:no:0
Shared::0:no::::::-:0:100:100:-:0:100:100:-:0:100:100:-:s:-:KB:-:s:-:-:-:-:MB:-:MB:-:MB:-:MB:no:proc:no:0

Commands to manage classes: mkclass, chclass, rmclass …

Command Description Usage
mkclass Creates a WLM classmkclass <class name> ; mkclass -a inheritance=yes -a localshm =yes <class name>
wlmassign Assigns a process to a WLM class wlmassign <class name> <process id>
lsclass Returns the list of superclasses lsclass
wlmcheck Checks WLM settings wlmcheck
rmclass Removes a WLM class rmclass <class name>
wlmcntrl -p Starts WLM in passive modewlmcntrl -p
wlmcntrl -a Starts WLM in active mode wlmcntrl -a
wlmcntrl -o Stops WLM wlmcntr -o
wlmcntrl -u Update WLM (refresh after modifications) wlmcntr -u

Monitoring

Multiple tools to monitor WLM

Here example of the class app1

[p630n02][/work]> acctcom -w | grep app1
prog1 user1 app1.Default pts/2 12:02:48 12:05:22 154.12 144.55 10008.00
prog1 user1 app1.Default pts/2 12:05:42 12:07:19 97.16 111.80 7705.00
prog1 user1 app1.Default pts/2 12:09:27 12:10:04 37.20 32.22 4370.00
prog1 user1 app1.Default pts/2 12:10:14 12:14:42 268.50 233.17 10256.00
prog1 user1 app1.Default pts/2 12:17:51 12:20:45 174.62 250.88 13296.00
[p630n02][/work]> acctcom -c app1
COMMAND START END REAL CPU MEAN
NAME USER TTYNAME TIME TIME (SECS) (SECS) SIZE(K)
prog1 user1 pts/2 12:02:48 12:05:22 154.12 144.55 10008.00
prog1 user1 pts/2 12:05:42 12:07:19 97.16 111.80 7705.00
prog1 user1 pts/2 12:09:27 12:10:04 37.20 32.22 4370.00
prog1 user1 pts/2 12:10:14 12:14:42 268.50 233.17 10256.00

Topas

[p630n02][/work]> topas -W
Topas Monitor for host: p630n02 Interval: 2 Mon Oct 25 15:13:04
2004
WLM-Class (Passive) CPU% Mem% Disk-I/O%
app1 47 1 0
app2 23 0 0
app3 12 55 0
System 0 7 0
Shared 0 1 0
Default 0 0 0
Unmanaged 0 14 0
Unclassified 0 0 0
aix/workloadmanager.1706354925.txt.gz · Last modified: 2024/01/27 12:28 by manu