[AIX 운영 체제와 장치 관리 45] 워크로드 관리자 관리 — 시작과 중지, 속성 파일, 속성 값 그룹, 시간 기반 구성 세트, 자원 세트, 워크로드 통합 구성 예

핵심 정리

  • WLM은 기본 운영 체제에 들어 있는 선택 서비스입니다. SMIT(smit wlmmanage)에서는 현재 세션, 다음 재부팅, 둘 다 가운데 골라 시작·중지하며, wlmcntrl 명령은 현재 세션에만 적용되므로 영구 적용하려면 /etc/inittab을 고칩니다.
  • WLM 구성은 /etc/wlm 아래 디렉터리의 속성 파일(classes, description, groupings, limits, shares, rules) 묶음이며 /etc/wlm/current 링크가 현재 구성을 가리킵니다.
  • groupings 파일에 속성 값 묶음을 정의하고 rules 파일에서 달러 기호로 포함, 느낌표로 제외합니다. .times 파일로 요일·시간대별 구성을 바꾸는 구성 세트를 만들고 wlmcntrl -u로 적용합니다.
  • 자원 세트(rset)로 클래스마다 다른 CPU 부분 집합을 주어 CPU 경합을 없앨 수 있습니다. bindprocessor 바인딩이나 다른 rset이 붙은 프로세스에는 WLM이 rset을 붙이지 않습니다.
  • 통합 구성 예는 수동 모드(wlmcntrl -p)로 사용량을 본 뒤 등급(tier), 공유, 최소·소프트 최대 한계를 정하고 wlmstat으로 다듬습니다. 서브클래스 수준만 수동 모드로 돌릴 수는 없습니다.
항목 내용
버전 AIX 6.1 (5.3판과 거의 같음)
원문 Operating system and device management — 5.3판 189200쪽, 6.1판 474485쪽
관련 명령어 wlmcntrl, wlmstat, wlmassign, wlmcheck, confsetcntrl, lswlmconf, lsrset, mkrset, topas, smit wlmmanage, smit addrsetcntl, smit reloadrsetcntl
관련 파일 /etc/wlm/current, /etc/wlm/standard, /etc/wlm/template, classes, description, groupings, limits, shares, rules, .times, /etc/rsets, /etc/inittab

WLM(Workload Manager)은 스케줄러와 VMM(가상 메모리 관리자)이 프로세스에 자원을 할당하는 방식을 시스템 관리자가 더 잘 제어하게 합니다. WLM으로 서로 다른 작업 클래스가 서로 방해하지 않게 하고 서로 다른 사용자 그룹의 요구에 따라 자원을 할당할 수 있습니다.

WLM으로 작업용 서비스 클래스를 여러 개 만들고 그 클래스의 속성을 지정할 수 있습니다. 이 속성은 클래스에 할당할 CPU, 물리 메모리, 디스크 I/O 처리량의 최소량과 최대량을 지정합니다. 그러면 WLM은 시스템 관리자가 준 클래스 할당 규칙으로 작업을 자동으로 클래스에 할당합니다. 이 할당 규칙은 프로세스 속성 집합의 값을 바탕으로 합니다. 시스템 관리자나 특권 사용자는 자동 할당을 무시하고 작업을 수동으로 클래스에 할당할 수도 있습니다.

WLM은 기본 운영 체제의 일부로 함께 설치되지만 선택 서비스입니다. 시스템 환경에 맞게 구성하고, 쓰고 싶을 때 시작하고, WLM 서비스를 잠시 멈추거나 끝내고 싶을 때 중지해야 합니다.

이 절에는 사이트에 알맞은 클래스와 규칙으로 WLM을 구성하는 절차와, 예상치 못한 자원 소비 동작의 문제 해결 제안이 있습니다.

주의: 이 절의 작업은 WLM 개념을 안다고 가정합니다. WLM을 효율적으로 쓰려면 기존 시스템 프로세스와 성능을 폭넓게 알아야 합니다. 시스템 관리자가 극단적이거나 부정확한 값으로 WLM을 구성하면 성능이 크게 떨어집니다.

관련 개념

  • 워크로드 관리 개념 — WLM으로 작업용 서비스 클래스를 여러 개 만들고 그 클래스의 속성을 지정할 수 있습니다.

워크로드 관리자 시작과 중지

WLM은 시작하고 중지해야 하는 선택 서비스입니다.

WLM을 시작하거나 중지할 때는 시스템 관리 인터페이스인 Web-based System Manager나 SMIT 가운데 하나를 쓰는 것이 좋습니다.

  • Web-based System Manager로 WLM을 시작하거나 중지하려면 세션 창에서 Workload Manager 아이콘을 고릅니다.
  • SMIT로 WLM을 시작하거나 중지하려면 smit wlmmanage 빠른 경로를 씁니다.

이 방법들의 핵심 차이는 영속성입니다. Web-based System Manager나 SMIT에서는 WLM을 세 가지 방식으로 시작하거나 중지할 수 있습니다.

옵션 동작
current session(현재 세션) 이 옵션으로 중지하면 이번 세션에서만 멈추고 다음 재부팅 때 다시 시작합니다. 이 옵션으로 시작하면 이번 세션에서만 시작하고 다음 재부팅 때는 다시 시작하지 않습니다.
next reboot(다음 재부팅) 이 옵션으로 중지하면 이번 세션에서는 계속 실행되고 다음 재부팅 때 다시 시작하지 않습니다. 이 옵션으로 시작하면 이번 세션에서는 쓸 수 없지만 다음 재부팅 때 시작합니다.
both(둘 다) 이 옵션으로 중지하면 이번 세션에서 멈추고 다음 재부팅 때도 다시 시작하지 않습니다. 이 옵션으로 시작하면 이번 세션에서 시작하고 다음 재부팅 때도 다시 시작합니다.

wlmcntrl 명령도 쓸 수 있지만 wlmcntrl 명령은 현재 세션에서만 WLM을 시작하거나 중지합니다. 명령행 인터페이스를 쓰면서 기계를 다시 부팅해도 변경이 유지되게 하려면 /etc/inittab 파일을 편집해야 합니다.

WLM으로 자원 소비를 클래스별 비율, 클래스별 총량, 프로세스별 총량으로 조절할 수 있습니다. WLM을 능동 모드로 실행하면 모든 자원 형식의 조절을 켤 수 있습니다. 선택적으로 새 프로세스와 기존 프로세스를 분류하고 여러 클래스의 자원 사용을 감시하되 그 사용을 조절하지는 않는 WLM 모드를 시작할 수 있습니다. 이 모드를 수동 모드라 합니다. 조절하고 싶은 자원이 CPU 시간뿐이면 CPU는 능동 모드로, 나머지 자원은 모두 수동 모드로 WLM을 실행할 수 있습니다. 이 모드를 CPU 전용 모드라 합니다.

WLM을 시작하기 전에 시스템에 있던 모든 프로세스는 새로 읽은 할당 규칙에 따라 분류되고 WLM이 감시합니다.

워크로드 관리자 속성

WLM 구성 속성은 Web-based System Manager, SMIT, WLM 명령행 인터페이스로 지정하거나 일반 ASCII 파일을 만들어 지정할 수 있습니다. Web-based System Manager와 SMIT 인터페이스는 WLM 명령으로 같은 일반 ASCII 파일, 곧 속성 파일에 정보를 기록합니다.

WLM 속성 파일 한 묶음이 WLM 구성 하나를 정의합니다. 속성 파일 묶음을 여러 개 만들어 서로 다른 워크로드 관리 구성을 정의할 수 있습니다. 이 구성은 /etc/wlm의 하위 디렉터리에 있습니다. Config 구성의 수퍼클래스를 설명하는 WLM 속성 파일은 /etc/wlm/Config의 classes, description, limits, shares, rules 파일입니다. 이 구성의 수퍼클래스 Super의 서브클래스를 설명하는 속성 파일은 /etc/wlm/Config/Super 디렉터리의 classes, limits, shares, rules 파일입니다. root 사용자만 WLM을 시작하거나 중지하거나 구성을 바꿀 수 있습니다.

속성 파일 이름은 다음과 같습니다.

파일 내용
classes 클래스 정의
description 구성 설명 텍스트
groupings 속성 값 그룹
limits 클래스 한계
shares 클래스 목표 공유
rules 클래스 할당 규칙

WLM 속성 파일을 제출하는 명령 wlmcntrl과 다른 WLM 명령에서는 WLM 속성 파일용 다른 디렉터리 이름을 지정할 수 있습니다. 그래서 기본 WLM 속성 파일을 바꾸지 않고 WLM 속성을 바꿀 수 있습니다.

심볼릭 링크 /etc/wlm/current는 현재 구성 파일이 든 디렉터리를 가리킵니다. 지정한 구성이나 구성 세트로 WLM을 시작할 때 wlmcntrl 명령으로 이 링크를 갱신합니다. 운영 체제와 함께 제공되는 견본 구성 파일은 /etc/wlm/standard에 있습니다.

속성 값 그룹 만들기

속성 값을 묶어 rules 파일에서 값 하나로 나타낼 수 있습니다. 이 속성 값 그룹은 WLM 구성 디렉터리 안 groupings 파일에 정의합니다.

기본적으로 구성에는 groupings 파일이 없습니다. 만드는 명령이나 관리 인터페이스도 없습니다. 속성 값 그룹을 만들어 쓰려면 다음 절차를 씁니다.

  1. root 권한으로 다음 예처럼 알맞은 구성 디렉터리로 옮깁니다.
text
cd /etc/wlm/MyConfig
  1. 좋아하는 편집기로 groupings라는 파일을 만들고 편집합니다. 예:
text
vi groupings
  1. 다음 형식으로 속성과 그 값을 정의합니다.

    attribute = value, value, ...

    모든 값은 쉼표로 구분해야 합니다. 공백은 의미가 없습니다. 범위와 와일드카드를 쓸 수 있습니다. 예:

text
trusted = user[0-9][0-9], admin*
nottrusted = user23, user45
shell = /bin/?sh, \
        /bin/sh, \
        /bin/tcsh
rootgroup=system,bin,sys,security,cron,audit
  1. 파일을 저장합니다.
  2. 클래스 선택 기준에 속성 그룹을 쓰려면 rules 파일을 편집합니다. 해당 값을 포함하려면 속성 그룹 이름 앞에 달러 기호($)를, 값을 제외하려면 느낌표(!)를 붙여야 합니다. 느낌표는 그룹 구성원(3단계)에 쓸 수 없으며, 이 rules 파일에서 그룹 앞에 쓸 수 있는 유일한 수식자입니다. 다음 예에서 별표(*)는 주석 줄을 나타냅니다.
text
*class  resvd  user                  group       application       type  tag
classA  -      $trusted,!$nottrusted  -           -                 -     -
classB  -      -                     -           $shell,!/bin/zsh  -     -
classC  -      -                     $rootgroup  -                 -     -
  1. 파일을 저장합니다.

이제 분류 규칙에 속성 값 그룹이 들어 있습니다. 규칙을 해석할 때 요소가 $로 시작하면 시스템은 groupings 파일에서 그 요소를 찾습니다. 요소의 구문이 틀렸거나 groupings 파일이 없으면 시스템은 경고 메시지를 표시하고 다른 규칙을 계속 처리합니다.

시간 기반 구성 세트 만들기

특수 구성 집합을 만들고, 집합 안 각 구성을 특정 구성이 적용되기를 바라는 요일과 시간에 배정할 수 있습니다.

시간 기반 구성 세트라는 이 집합은 일반 구성과 완전히 별개이지만 호환됩니다. 필요에 따라 wlmcntrl -u 명령으로 구성 세트와 일반 구성 사이를 바꿀 수 있습니다.

구성 세트를 쓸 때는 기존 이름 붙은 구성을 보통 특정 시간 범위와 연결합니다. 한 번에 구성 하나만 쓸 수 있으므로 지정한 시간 범위는 저마다 고유해야 합니다. 시간 범위는 겹치거나 중복될 수 없습니다.

wlmd 데몬은 지정한 구성이 시간 범위를 벗어나 다른 구성을 써야 할 때 WLM에 알립니다. root 사용자만 이 시간 범위를 관리할 수 있으며, 시간 범위는 구성 세트 디렉터리 안 .times라는 ASCII 파일에 지정합니다.

다음 절차로 시간 기반 구성 세트를 만듭니다.

  1. root 권한으로 구성 세트 디렉터리를 만들고 그 디렉터리로 옮깁니다. 예:
text
mkdir /etc/wlm/MyConfigSet
cd /etc/wlm/MyConfigSet
  1. 좋아하는 편집기로 구성 세트의 .times 파일을 만들고 다음 형식으로 구성과 시간 범위를 지정합니다.
text
ConfigurationName :
            time = " N - N , HH : MM - HH : MM "

또는

text
ConfigurationName :
            time = -

(시간 값을 지정하지 않음) N은 0(일요일)부터 6(토요일)까지 요일을 나타내는 숫자이고, HH는 00(자정)부터 23(오후 11시)까지 시, MM은 00부터 59까지 분입니다. 요일만 지정하거나 아예 지정하지 않을 수 있습니다. 분 값이 00이면 하루의 끝 시로 24를 쓸 수 있습니다. 어떤 구성에 시간 범위 대신 대시(-)를 입력하면 다른 구성의 시간 범위가 적용되지 않을 때 그 구성을 씁니다. 시간 범위 없이 지정할 수 있는 구성은 하나뿐입니다. 예:

text
conf1:
    time =
conf2:
    time = "1-5,8:00-17:00"
conf2
    time = "6-0,14:00-17:00"
conf3
    time = "22:00-6:00"
  1. wlmcntrl -u 명령으로 새 구성 세트를 WLM에 반영합니다. 예:
text
wlmcntrl -u /etc/wlm/MyConfigSet

이제 WLM의 현재 구성은 새 시간 기반 구성 세트입니다.

confsetcntrl과 lswlmconf 명령으로도 구성 세트를 만들고 다룰 수 있습니다. 예:

기본 구성이 conf1인 구성 세트 confset1을 만들려면 다음 명령을 씁니다.

text
confsetcntrl -C confset1 conf1

conf2를 confset1에 더하고 매일 오전 8시부터 오후 5시까지 활성 구성으로 하려면 다음 명령을 씁니다.

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

이 구성 세트를 활성 구성으로 하려면 다음 명령을 씁니다.

text
wlmcntrl -d confset1

자원 세트 만들기

자원 세트(rset)를 쓰면 CPU에 관해 워크로드를 서로 효과적으로 격리할 수 있습니다. 서로 다른 워크로드 둘을 클래스 둘로 나누고 클래스마다 서로 다른 CPU 부분 집합을 주면, 두 워크로드가 물리 메모리와 I/O 대역폭은 여전히 다투더라도 CPU 자원은 결코 다투지 않게 할 수 있습니다.

자원 세트를 만드는 가장 간단한 방법은 SMIT 인터페이스(smit addrsetcntl 빠른 경로)나 mkrset 명령을 쓰는 것입니다.

설명을 위해 다음 예는 4웨이 시스템에서 자원 세트를 만들고 이름 붙이는 각 단계를 보여 줍니다. 프로세서 0~2가 든 자원 세트를 만들고 WLM 구성에서 써서 수퍼클래스의 모든 프로세스를 이 세 프로세서로 제한하는 것이 목표입니다.

  1. root 권한으로 다음 명령을 써서 (자원 세트를 만들) 쓸 수 있는 구성 요소를 봅니다.
text
lsrset -av

이 예의 출력은 다음과 같습니다.

text
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

출력에서 sys/sys0은 시스템 전체(이 경우 4웨이 SMP)를 나타냅니다. WLM 클래스가 rset 속성을 지정하지 않으면 이것이 그 프로세스가 접근할 수 있는 기본 세트입니다. 2. 다음 SMIT 빠른 경로로 자원 세트를 만들고 이름을 붙입니다.

text
smit addrsetcntl

이 예에서는 필드를 다음과 같이 채웁니다.

  • Name Space — admin
  • Resource Set Name — proc0_2
  • Resources — 목록에서 메모리와 CPU 0~2(sys/cpu.00000부터 sys.cpu.00002)에 해당하는 줄을 고릅니다.
  • 그 밖의 모든 필드 — 목록에서 고릅니다.

필드를 다 입력하고 SMIT를 나가면 /etc/rsets에 admin/proc0_2 rset이 만들어집니다. 3. 새 rset을 쓰려면 다음 SMIT 빠른 경로로 커널 데이터 구조에 더합니다.

text
smit reloadrsetcntl

이 메뉴에서는 데이터베이스를 now(지금), at next boot(다음 부팅 때), both(둘 다) 다시 읽을 수 있습니다. 새 자원 세트를 처음 쓰는 것이므로 이 rset을 지금과 매번 재부팅 뒤에 읽도록 both를 고릅니다. (기존 rset을 바꿨다면 아마 now를 골랐을 것입니다.) 4. 다음 SMIT 빠른 경로로 새 rset을 WLM 클래스에 더합니다.

text
smit wlmclass_gal

클래스(이 예에서는 super1)를 고른 뒤 Resource Set 필드에 쓸 수 있는 목록에서 admin/proc0_2를 고릅니다. 고르고 SMIT를 나가면 디스크의 classes 파일이 바뀝니다. 5. 다음 가운데 하나를 합니다.

  • WLM이 실행 중이면 다음 SMIT 빠른 경로로 구성을 갱신합니다.
text
smit wlmupdate
  • WLM이 실행 중이 아니면 다음 SMIT 빠른 경로로 시작합니다.
text
smit wlmstart
  1. 새 자원 세트가 클래스에 주는 효과를 감시합니다. 예:
    1. 클래스 super1에서 CPU 루프(무한 루프를 실행하는 프로그램) 90개를 시작합니다.
    2. 명령행에 wlmstat을 입력합니다. 이 예의 출력은 다음과 같습니다.
text
       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

이 출력은 제약이 없었다면 CPU를 100% 차지했을 CPU 집약 프로세스 90개가, 자원 세트가 CPU 0~2에서만 실행하도록 제한하므로 이제 75%만 쓴다는 것을 보여 줍니다. 3. (PID로 식별한) 프로세스가 어느 자원 세트에 접근하는지 확인하려면 다음 SMIT 빠른 경로를 씁니다.

text
smit lsrsetproc

관심 있는 프로세스의 PID를 입력하거나 목록에서 고릅니다. 다음은 루프 프로세스 하나의 출력입니다.

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

그러나 rset 속성을 지정하지 않은 클래스의 프로세스는 배타 자원 세트에 속한 프로세서를 뺀 모든 프로세서가 든 Default 자원 세트를 씁니다. 어느 클래스에도 속하지 않은 프로세스는 (root 프로세스이면) System 클래스나 (root가 아닌 프로세스이면) Default 클래스를 씁니다. 두 클래스 모두 자원 세트가 정의돼 있을 수 있습니다. 다음은 자원 세트를 지정하지 않은 클래스에 있는 init 프로세스의 출력입니다.

text
CPU  Memory  Resources
  4   98298  sys/sys0

이제 자원 세트가 있고 WLM 안 적어도 클래스 하나가 쓰고 있습니다.

참고: WLM은 지금 bindprocessor 서브루틴 바인딩이나 다른 rset 연결이 있는 프로세스에는 rset 연결을 설정하지 않습니다. 다른 연결이 없어지면 WLM이 자동으로 rset을 할당합니다.

참고: 자원 세트는 Default와 System 클래스를 포함해 어떤 WLM 클래스에도 만들 수 있습니다.

관련 개념

  • 워크로드 관리자의 자원 세트 레지스트리 — rset 레지스트리 서비스로 시스템 관리자가 자원 세트를 정의하고 이름을 붙여 다른 사용자나 응용 프로그램이 쓰게 할 수 있습니다.

관련 정보

  • lsrset 명령

워크로드 통합을 위한 워크로드 관리자 구성

WLM(Workload Manager)으로 시스템에서 작업이 쓰는 자원을 제어할 수 있습니다.

설치된 모든 AIX 운영 체제에는 기본 WLM 구성 템플릿이 있습니다. 다음 절차는 공유 서버에 자원 관리 정책을 구현하도록 WLM 구성 템플릿을 갱신합니다. 결과 구성은 시험의 출발점으로 쓸 수 있습니다. WLM을 정확히 어떻게 구성할지는 환경의 워크로드와 정책 요구에 달려 있습니다.

참고

  1. WLM을 효율적으로 쓰려면 기존 시스템 프로세스와 성능을 폭넓게 알아야 합니다. 워크로드에 잘 맞는 구성을 만들기까지 시험과 조정을 거듭해야 할 것입니다. 극단적이거나 부정확한 값으로 WLM을 구성하면 시스템 성능이 크게 떨어질 수 있습니다.
  2. 프로세스의 분류 속성(예: 사용자, 그룹, 응용 프로그램 이름)을 하나 이상 이미 알면 WLM 구성이 더 간단합니다. 현재 자원 사용을 잘 모르면 topas 같은 도구로 자원을 주로 쓰는 프로세스를 찾고, 그 결과를 클래스와 규칙 정의의 출발점으로 씁니다.
  3. 다음 시나리오는 워크로드 관리 개념에서 설명한 기본 WLM 개념을 안다고 가정합니다.

WLM 구성 파일은 /etc/wlm/ConfigurationName 디렉터리에 있습니다. 각 수퍼클래스의 각 서브클래스는 /etc/wlm/ConfigurationName/SuperClassName이라는 구성 파일에 정의합니다. 이 파일에 관한 자세한 내용은 Files Reference를 봅니다.

다음 절차에서는 두 부서 서버의 워크로드를 큰 서버 하나로 통합합니다. 이 예는 구성 파일을 편집하지만, SMIT(smit wlmconfig_create 빠른 경로)나 Web-based System Manager(Workload Manager 컨테이너, Configuration/Classes 컨테이너를 고른 뒤 Workload 메뉴에서 New Configuration)로 구성을 만들 수도 있습니다. 이 절차에서 할 일을 간단히 줄이면 다음과 같습니다.

  1. 통합할 응용 프로그램의 자원 요구를 파악합니다. 큰 서버로 옮길 수 있는 응용 프로그램 수를 정하는 데 도움이 됩니다.
  2. 통합 워크로드로 시험을 시작하도록 등급, 자원 공유와 한계를 정의합니다.
  3. 원하는 결과를 얻을 때까지 구성을 다듬습니다.

이 방법 시나리오의 정보는 특정 AIX 버전으로 시험했습니다. 얻는 결과는 AIX 버전과 수준에 따라 크게 다를 수 있습니다.

1단계. 응용 프로그램 요구 파악

이 시나리오의 워크로드는 데이터베이스 서버에서 흔히 볼 만한 것입니다. 작업이 다음 일반 범주로 나뉜다고 가정합니다.

범주 설명
Listeners(리스너) 대부분 잠들어 있다가 요청에 응해 주기적으로 깨어나는 프로세스입니다. 자원을 많이 쓰지 않지만 응답 시간이 중요할 수 있습니다.
Workers(워커) 요청이 로컬이든 원격이든 요청을 대신해 일을 하는 프로세스입니다. CPU 시간과 메모리를 많이 쓸 것입니다.
Reporters(리포터) 자동화된 작업을 하는 프로세스입니다. CPU 시간이나 메모리가 많이 필요할 수 있지만 느린 응답 시간을 견딜 수 있습니다.
Monitors(모니터) 보통 주기적으로 실행해 시스템이나 응용 프로그램 상태를 확인하는 프로세스입니다. 자원을 상당히 쓸 수 있지만 잠깐뿐입니다.
Commands(명령) 시스템 사용자가 언제든 실행할 수 있는 명령이나 다른 응용 프로그램입니다. 자원 요구를 예측할 수 없습니다.

이 작업과 함께 예약 작업은 다음 범주 가운데 하나에 속합니다.

범주 설명
SysTools 자동화된 작업을 하는 프로세스입니다. 시스템 운영에 결정적이지 않지만 주기적으로, 일정한 시간 제약 안에 실행해야 합니다.
SysBatch 드물게 실행하고 시스템 운영에 결정적이지 않으며 제때 끝날 필요가 없는 프로세스입니다.

구성을 만드는 첫 단계는 클래스와 규칙을 정의하는 것입니다. 다음 단계에서는 위에 나열한 일반 작업 범주로 클래스를 정의합니다. 다음 절차를 씁니다.

  1. 다음 명령으로 /etc/wlm 디렉터리 안에 MyConfig라는 새 구성을 만듭니다.
text
mkdir /etc/wlm/MyConfig
  1. 다음 명령으로 템플릿 파일을 /etc/wlm/MyConfig 디렉터리로 복사합니다.
text
cp -pr /etc/wlm/template/* /etc/wlm/MyConfig
  1. 수퍼클래스를 만들려면 좋아하는 편집기로 /etc/wlm/MyConfig/classes 파일을 다음 내용이 되도록 고칩니다.
text
System:
Default:
DeptA:
DeptB:
SysTools:
SysBatch:

출발점으로 (두 부서가 서버를 함께 쓰므로) 부서마다 수퍼클래스를 하나씩 정의합니다. SysTool과 SysBatch 수퍼클래스는 위 일반 범주에서 설명한 예약 작업을 맡습니다. System과 Default 수퍼클래스는 늘 정의돼 있습니다. 4. MyConfig 디렉터리 안에 DeptA와 DeptB 수퍼클래스마다 디렉터리를 만듭니다. (구성을 만들 때는 서브클래스가 있는 모든 수퍼클래스마다 디렉터리를 만들어야 합니다.) 다음 단계에서 부서 수퍼클래스마다 서브클래스 다섯 개(작업 범주마다 하나)를 정의합니다. 5. 일반 작업 범주마다 서브클래스를 만들려면 /etc/wlm/MyConfig/DeptA/classes와 /etc/wlm/MyConfig/DeptB/classes 파일을 다음 내용이 되도록 편집합니다.

text
Listen:
Work:
Monitor:
Report:
Command:

참고: classes 파일 내용은 수퍼클래스마다 다를 수 있습니다. 클래스를 정한 뒤 다음 단계에서 수퍼클래스와 서브클래스 수준에서 프로세스를 분류하는 데 쓸 분류 규칙을 만듭니다. 간단하게 하려고 모든 응용 프로그램이 알려진 위치에서 실행되고, 한 부서의 모든 프로세스는 deptA UNIX 그룹으로, 다른 부서의 프로세스는 deptB UNIX 그룹으로 실행된다고 가정합니다. 6. 수퍼클래스 할당 규칙을 만들려면 /etc/wlm/MyConfig/rules 파일을 다음 내용이 되도록 고칩니다.

text
DeptA - - deptA - -
DeptB - - deptB - -
SysTools - root,bin - /usr/sbin/tools/* -
SysBatch - root,bin - /usr/sbin/batch/* -
System - root - - -
Default - - - - -

참고: 같은 응용 프로그램의 인스턴스가 여럿 실행될 수 있고 (태그를 뺀) 모든 분류 속성이 같으면, wlmassign 명령이나 wlm_set_tag 서브루틴으로 서로 다른 클래스에 할당해 구분합니다. 7. 더 구체적인 서브클래스 규칙을 만들려면 /etc/wlm/MyConfig/DeptA/rules와 /etc/wlm/MyConfig/DeptB/rules 파일을 다음 내용으로 만듭니다.

text
Listen - - - /opt/myapp/bin/listen* -
Work - - - /opt/myapp/bin/work* -
Monitor - - - /opt/bin/myapp/bin/monitor -
Report - - - /opt/bin/myapp/report* -
Command - - - /opt/commands/* -
  1. 클래스마다 자원 소비 동작을 알아보려면 다음 명령으로 WLM을 수동 모드로 시작합니다.
text
wlmcntrl -p -d MyConfig

WLM을 수동 모드로 시작한 뒤 먼저 응용 프로그램을 하나씩 따로 실행해 자원 요구를 더 자세히 볼 수 있습니다. 그런 다음 모든 응용 프로그램을 함께 실행해 모든 클래스 사이 상호 작용을 더 잘 알아볼 수 있습니다.

응용 프로그램 자원 요구를 파악하는 다른 방법은 응용 프로그램을 통합해 올 개별 서버에서 먼저 WLM을 수동 모드로 실행하는 것입니다. 이 방법의 단점은 큰 시스템에서 구성을 다시 만들어야 하고, 큰 시스템에서는 필요한 자원 비율이 달라질 가능성이 크다는 점입니다.

2단계. 등급, 공유, 한계 정의

WLM 구성은 자원 관리 정책의 구현입니다. WLM을 수동 모드로 실행하면 자원 관리 정책이 주어진 워크로드에 합리적인지 판단하는 데 도움이 되는 정보를 얻습니다. 이제 자원 관리 정책에 따라 워크로드를 조절하도록 등급, 공유, 한계를 정의할 수 있습니다.

이 시나리오에서는 다음 요구가 있다고 가정합니다.

  • System 클래스는 가장 높은 우선순위를 가지고 늘 시스템 자원의 일정 비율에 접근이 보장돼야 합니다.
  • SysTools 클래스는 늘 일정 비율의 자원에 접근할 수 있어야 하지만, DeptA와 DeptB에서 실행 중인 응용 프로그램에 크게 영향을 줄 만큼은 아니어야 합니다.
  • SysBatch 클래스는 시스템의 다른 어떤 작업도 방해하면 안 됩니다.
  • DeptA는 쓸 수 있는 자원(공유가 있는 클래스가 쓸 수 있는 자원)의 60%를, DeptB는 40%를 받습니다. DeptA와 DeptB 안에서는 다음과 같습니다.
    • Listen 클래스의 프로세스는 낮은 지연으로 요청에 응답해야 하지만 자원을 많이 쓰면 안 됩니다.
    • Work 클래스는 자원을 가장 많이 쓸 수 있어야 합니다. Monitor와 Command 클래스는 자원을 어느 정도 쓰되 Work 클래스보다 적게 써야 합니다.
    • Report 클래스는 다른 어떤 작업도 방해하면 안 됩니다.

다음 절차에서 등급, 공유, 한계를 정의합니다.

  1. 수퍼클래스 등급을 만들려면 좋아하는 편집기로 /etc/wlm/MyConfig/classes 파일을 다음 내용이 되도록 고칩니다.
text
System:
Default:
DeptA:
        localshm = yes
        adminuser = adminA
        authuser = adminA
        inheritance = yes
DeptB:
        localshm = yes
        adminuser = adminB
        authuser = adminB
        inheritance = yes
SysTools:
        localshm = yes
SysBatch:
        tier = 1
        localshm = yes

SysBatch 수퍼클래스는 시스템의 나머지 작업을 방해하지 않기를 바라는 아주 낮은 우선순위 작업이 들었으므로 등급 1에 둡니다. (등급을 지정하지 않으면 클래스는 기본으로 등급 0입니다.) 각 부서 수퍼클래스의 관리는 adminuser와 authuser 속성으로 정의합니다. DeptA와 DeptB에는 inheritance 속성을 켭니다. 상속이 켜진 클래스에서 시작한 새 프로세스는 모두 그 클래스에 분류된 채로 남습니다. 2. 작업 그룹마다 서브클래스 등급을 만들려면 /etc/wlm/MyConfig/DeptA/classes와 /etc/wlm/MyConfig/DeptB/classes 파일을 다음 내용이 되도록 고칩니다.

text
Listen:
Work:
Monitor:
Report:
        tier = 1
Command:
  1. 수퍼클래스의 초기 공유를 지정하려면 /etc/wlm/MyConfig/shares 파일을 다음 내용이 되도록 편집합니다.
text
DeptA:
        CPU = 3
        memory = 3
DeptB:
        CPU = 2
        memory = 2

CPU 공유를 모두 5개 지정했으므로 DeptA 프로세스는 전체 CPU 자원의 5분의 3(60%)에, DeptB 프로세스는 5분의 2(40%)에 접근합니다. SysTools, System, Default 클래스에는 공유를 지정하지 않았으므로 이들의 소비 목표는 활성 공유 수와 상관없이 정해지며, (한계에 이를 때까지) DeptA와 DeptB보다 높은 우선순위로 자원에 접근합니다. SysBatch 클래스는 등급 1의 유일한 수퍼클래스이므로 공유를 지정해도 의미가 없어 지정하지 않았습니다. SysBatch 클래스의 작업은 등급 0의 모든 클래스가 쓰지 않는 자원만 쓸 수 있습니다. 4. 서브클래스의 초기 공유를 지정하려면 /etc/wlm/MyConfig/DeptA/shares와 /etc/wlm/MyConfig/DeptB/shares 파일을 다음 내용이 되도록 편집합니다.

text
Work:
        CPU = 5
        memory = 5
Monitor:
        CPU = 4
        memory = 1
Command:
        CPU = 1
        memory = 1

Listen 클래스에는 공유를 지정하지 않았으므로 자원이 필요할 때 (수퍼클래스 안에서) 가장 높은 우선순위로 접근합니다. Work 클래스는 자원 요구가 가장 크므로 공유를 가장 많이 지정했습니다. 그에 맞춰 Monitor와 Command 클래스에는 관찰한 동작과 상대적 중요도에 따라 공유를 지정했습니다. Report 클래스는 등급 1의 유일한 서브클래스이므로 공유를 지정해도 의미가 없어 지정하지 않았습니다. Report 클래스의 작업은 등급 0의 서브클래스가 쓰지 않는 자원만 쓸 수 있습니다. 이 예의 다음 단계에서는 공유를 지정하지 않은 클래스에 한계를 지정합니다. (공유가 있는 클래스에도 한계를 지정할 수 있습니다. 자세한 내용은 WLM을 이용한 자원 관리를 봅니다.) 5. 수퍼클래스에 한계를 지정하려면 /etc/wlm/MyConfig/limits 파일을 다음 내용이 되도록 편집합니다.

text
Default:
        CPU = 0%-10%;100%
        memory = 0%-10%;100%
SysTools:
        CPU = 0%-10%;100%
        memory = 0%-5%;100%
System:
        CPU = 5%-50%;100%
        memory = 5%-50%;100%

System, SysTools, Default 클래스가 시스템의 다른 작업을 크게 방해하지 않도록 소프트 최대 한계를 지정했습니다. System 클래스에는 시스템 운영에 꼭 필요한 프로세스가 들어 있어 보장된 자원량을 쓸 수 있어야 하므로 CPU와 메모리에 최소 한계를 지정했습니다. 6. 서브클래스에 한계를 지정하려면 /etc/wlm/MyConfig/DeptA/limits와 /etc/wlm/MyConfig/DeptB/limits 파일을 다음 내용이 되도록 편집합니다.

text
Listen:
        CPU = 10%-30%;100%
        memory = 10%-20%;100%
Monitor:
        CPU = 0%-30%;100%
        memory = 0%-30%;100%

참고: 한계는 서브클래스 파일마다 다를 수 있습니다. Listen과 Monitor 클래스가 같은 수퍼클래스 안 다른 서브클래스를 크게 방해하지 않도록 소프트 최대 한계를 지정했습니다. 특히 Work 클래스가 요청을 처리할 자원에 접근할 수 없는데 시스템이 Work 클래스 작업 요청을 계속 받아들이기를 바라지 않습니다. 빠른 응답 시간을 보장하려고 Listen 클래스에 최소 한계도 지정했습니다. 메모리 최소 한계는 이 클래스가 쓰는 페이지가 페이지 교체로 빼앗기지 않게 해 실행 시간을 빠르게 합니다. CPU 최소 한계는 이 프로세스가 실행될 수 있을 때 (수퍼클래스 안에서) CPU 자원에 가장 높은 우선순위로 접근하게 합니다.

3단계. 워크로드 관리자 구성 다듬기

  1. wlmstat 명령으로 시스템을 감시하고, WLM의 조절이 목표에 맞는지, 어떤 응용 프로그램은 자원을 지나치게 빼앗기고 다른 것은 마땅한 몫보다 많이 얻고 있지 않은지 확인합니다. 그렇다면 공유를 조정하고 WLM을 새로 고칩니다.
  2. 공유, 한계, 등급 번호를 감시하고 조정하면서 일부 또는 모든 수퍼클래스의 서브클래스 관리를 위임할지 정합니다. 그러면 관리자가 서브클래스 공유, 한계, 등급 번호를 감시하고 설정할 수 있습니다.

각 수퍼클래스 관리자는 수퍼클래스마다 서브클래스에 이 과정을 반복할 수 있습니다. 차이는 WLM을 서브클래스 수준에서만 수동 모드로 실행할 수는 없다는 점뿐입니다. 서브클래스 구성과 조정은 WLM이 능동 모드일 때 해야 합니다. 수퍼클래스 안 사용자와 응용 프로그램에 영향을 주지 않는 한 방법은 서브클래스의 등급 번호, 공유, 한계를 기본값(공유는 '-'(하이픈), 최소는 0%, 소프트와 하드 최대는 100%)으로 시작하는 것입니다. 이 설정이면 WLM은 서브클래스 사이 자원 할당을 조절하지 않습니다.

더 많은 정보

  • Workload Manager
  • Workload Management
  • Performance management의 Workload Management Diagnosis
  • Performance Toolbox Version 3: Guide and Reference의 Analyzing WLM with wlmperf
  • Files Reference의 classes, limits, rules, shares 파일 설명
  • topas, wlmassign, wlmcheck, wlmcntrl, wlmmon, wlmperf, wlmstat 명령
  • WLM 서브루틴 설명, 특히 wlm_set_tag

관련 개념

  • 워크로드 관리자 설정 — 클래스 정의, 클래스 속성, 공유와 한계, 자동 클래스 할당 규칙은 Web-based System Manager, SMIT, WLM 명령행 인터페이스로 입력할 수 있습니다. 이 정의와 규칙은 텍스트 편집기로도 만들거나 고칠 수 있는 일반 텍스트 파일에 보관됩니다.
영어 원문

Administering Workload Manager

Workload Manager (WLM) gives system administrators more control over how the scheduler and the virtual memory manager (VMM) allocate resources to processes. Using WLM, you can prevent different classes of jobs from interfering with each other and you can allocate resources based on the requirements of different groups of users.

WLM lets you create different classes of service for jobs, as well as specify attributes for those classes. These attributes specify minimum and maximum amounts of CPU, physical memory, and disk I/O

throughput to be allocated to a class. WLM then assigns jobs automatically to classes using class assignment rules provided by a system administrator. These assignment rules are based on the values of a set of attributes for a process. Either the system administrator or a privileged user can also manually assign jobs to classes, overriding the automatic assignment.

WLM 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 contains procedures for configuring WLM with classes and rules that are appropriate for your site and suggestions for troubleshooting unexpected resource consumption behavior.

Attention: The tasks in this section assume you are familiar with WLM concepts. Efficient use of WLM requires extensive knowledge of existing system processes and performance. If the system administrator configures WLM with extreme or inaccurate values, performance will be significantly degraded.

Related concepts

Workload management concepts With WLM, you can create different classes of service for jobs, as well as specify attributes for those classes.

Starting up and shutting down Workload Manager

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.

  • To start or stop WLM using Web-based System Manager, select the Workload Manager icon from the session window.

  • To start or stop WLM using SMIT, use the smit wlmmanage fast path.

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.

Workload Manager 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 groupings 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:
text
cd /etc/wlm/MyConfig
  1. Use your favorite editor to create and edit a file named groupings. For example:
text
vi groupings
  1. 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:

text
trusted = user[0-9][0-9], admin*
nottrusted = user23, user45
shell = /bin/?sh, \
        /bin/sh, \
        /bin/tcsh
rootgroup=system,bin,sys,security,cron,audit
  1. Save the file.

  2. 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 on page 476), 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:

text
*class  resvd  user                  group       application       type  tag
classA  -      $trusted,!$nottrusted  -           -                 -     -
classB  -      -                     -           $shell,!/bin/zsh  -     -
classC  -      -                     $rootgroup  -                 -     -
  1. 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:
text
mkdir /etc/wlm/MyConfigSet
cd /etc/wlm/MyConfigSet
  1. Use your favorite editor to create the configuration set's .times file and specify the configuration and time ranges in the following format:
text
ConfigurationName :
            time = " N - N , HH : MM - HH : MM "

or

text
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:

text
conf1:
    time =
conf2:
    time = "1-5,8:00-17:00"
conf2
    time = "6-0,14:00-17:00"
conf3
    time = "22:00-6:00"
  1. Use the wlmcntrl -u command to update WLM with the new configuration set. For example:
text
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:

text
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:

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

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

text
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:
text
lsrset -av

The output for this example is the following:

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

  1. Create and name the resource set using the following SMIT fast path:
text
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.

  1. To use the new rset, add it into the kernel data structures using the following SMIT fast path:
text
smit reloadrsetcntl

This menu gives you the option to reload the database 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.)

  1. Add the new rset to a WLM class using the following SMIT fast path:
text
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.

  1. Do one of the following:
  • If WLM is running, update the configuration using the following SMIT fast path:
text
smit wlmupdate
  • If WLM is not running, start it using the following SMIT fast path:
text
smit wlmstart
  1. Monitor the effect of the new resource set on the class. For example: a. Start 90 CPU loops (program executing an infinite loop) in class super1. b. Type wlmstat on the command line. The output for this example is the following
text
       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. c. To verify what resource set a process (identified by its PID) has access to, use the following SMIT fast path:

text
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:

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

However, a process from a class without a specified rset attribute uses the Default resource set that includes all processors except those processors that are part of an exclusive resource set. A process that does not belong to any class uses the System class (if it is a root process) or a Default class (if it is a nonroot process). Either of these classes might have resource sets that are defined for them. The following output is from the init process, which is in a class that does not specify a resource set:

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

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.

Note: Resource sets can be created for any WLM class, which includes the Default and System classes.

Related concepts

Resource set registry in Workload Manager The rset registry services enable system administrators to define and name resource sets so that they can then be used by other users or applications.

Related information

lsrset command

Configuring Workload Manager to consolidate workloads

Workload Manager (WLM) gives you control over the resources used by jobs on your system.

A default WLM configuration template exists on every installed AIX operating system. The following procedure updates the WLM configuration template to implement a resource-management policy on a shared server. The resulting configuration can be used as a starting point for testing. Exactly how you configure WLM will depend on the workload and policy requirements for your environment.

Note

  1. Efficient use of WLM requires extensive knowledge of existing system processes and performance. Repeated testing and tuning will probably be needed before you can develop a configuration that works well for your workload. If you configure WLM with extreme or inaccurate values, you can significantly degrade system performance.

  2. The process of configuring WLM is simpler when you already know one or more of the classification attributes of a process (for example, user, group, or application name). If you are unfamiliar with the

current use of resources, use a tool such as topas to identify the processes that are the primary resource users and use the resulting information as the starting point for defining classes and rules.

  1. The following scenario assumes you are familiar with the basic Workload Manager concepts as described in Workload management concepts.

The WLM configuration files exist in the /etc/wlm/ConfigurationName directory. Each subclass for each superclass is defined in a configuration file named /etc/wlm/ConfigurationName/SuperClassName. For more information about these files, see the Files Reference.

In the following procedure, you consolidate the workloads from two separate department servers onto one larger server. This example edits the configuration files, but you can also create a configuration using SMIT (use the smit wlmconfig_create fast path) or Web-based System Manager (select the Workload Manager container, select the Configuration/Classes container, then from the Workload menu, select New Configuration). Briefly, in this procedure, you will do the following:

  1. Identify the resource requirements of the applications you want to consolidate. This will help you determine how many applications you can move to the larger server.

  2. Define tiers, as well as resource shares and limits, to begin testing with the consolidated workload.

  3. Fine-tune the configuration until you achieve your desired results.

The information in this how-to scenario was tested using specific versions of AIX. The results you obtain might vary significantly depending on your version and level of AIX.

Step 1. Identify application requirements

In this scenario, the workload is typical of what you might see on a database server. Assume the jobs fall into the following general categories:

Listeners

These are processes that sleep most of the time and wake up periodically in response to a request. Although these processes do not consume a lot of resources, response time can be critical.

Workers

These are processes that do the work on behalf of a request, whether the request is local or remote. These processes probably use a lot of CPU time and memory.

Reporters

These are processes that do automated tasks. They might require a lot of CPU time or memory, but they can tolerate a slower response time.

Monitors

These are processes that typically run periodically to verify the state of the system or applications. These processes might use a significant amount of resource, but only for a short time.

Commands

These are commands or other applications that system users might run at any time. Their resource requirements are unpredictable.

In addition to this work, scheduled jobs fall into one of the following categories:

SysTools

These are processes that perform automated tasks. These jobs are not critical to system operation but need to run periodically and within certain time constraints.

SysBatch

These are processes that run infrequently, are not critical to system operation, and need not finish in a timely manner.

The first step of creating a configuration is to define classes and rules. In the following steps, you will use the general job categories listed above to define your classes. Use the following procedure:

  1. Make a new configuration within the /etc/wlm directory called MyConfig using the following command:
text
mkdir /etc/wlm/MyConfig
  1. Copy the template files into the /etc/wlm/MyConfig directory using the following command:
text
cp -pr /etc/wlm/template/* /etc/wlm/MyConfig
  1. To create the superclasses, use your favorite editor to modify the /etc/wlm/MyConfig/classes file to contain the following:
text
System:
Default:
DeptA:
DeptB:
SysTools:
SysBatch:

As a starting point, you define one superclass for each department (because two departments will be sharing the server). The SysTool and SysBatch superclasses will handle the scheduled jobs outlined in the general categories above. The System and Default superclasses are always defined.

  1. Within the MyConfig directory, create a directory for each the DeptA and DeptB superclasses. (When creating a configuration, you must create a directory for every superclass that has subclasses.) In the following step, you define five subclasses (one for each category of work) for each department's superclass.

  2. To create subclasses for each general category of jobs, edit the /etc/wlm/MyConfig/DeptA/classes and /etc/wlm/MyConfig/DeptB/classes files to contain the following:

text
Listen:
Work:
Monitor:
Report:
Command:

Note: The contents of the classes file can be different for each superclass. After the classes are identified, in the following step, you create the classification rules that are used to classify processes at the superclass and subclass levels. For the sake of simplicity, assume that all applications run from known locations, that all processes from one department run under the deptAUNIX group, and that processes from the other department run under the deptB UNIX group.

  1. To create the superclass assignment rules, modify the /etc/wlm/MyConfig/rules file to contain the following:
text
DeptA - - deptA - -
DeptB - - deptB - -
SysTools - root,bin - /usr/sbin/tools/* -
SysBatch - root,bin - /usr/sbin/batch/* -
System - root - - -
Default - - - - -

Note: If more than one instance of the same application can be running and all classification attributes (other than the tag) are the same, use the wlmassign command or wlm_set_tag subroutine to differentiate between them by assigning them to different classes.

  1. To create more specific subclass rules, create the /etc/wlm/MyConfig/DeptA/rules and /etc/wlm/MyConfig/DeptB/rules files with the following content:
text
Listen - - - /opt/myapp/bin/listen* -
Work - - - /opt/myapp/bin/work* -
Monitor - - - /opt/bin/myapp/bin/monitor -
Report - - - /opt/bin/myapp/report* -
Command - - - /opt/commands/* -
  1. To determine the resource-consumption behavior of each class, start WLM in passive mode using the following command:
text
wlmcntrl -p -d MyConfig

After starting WLM in passive mode, you can run each application separately at first to gain a finer perspective of its resource requirements. You can then run all applications simultaneously to better determine the interaction among all classes.

An alternative method of identifying the application resource requirements might be to first run WLM in passive mode on the separate servers from which you are consolidating applications. The disadvantages to this approach are that you would have to re-create the configurations on the larger system, and the required percentage of resources will likely be different on the larger system.

Step 2. Define Tiers, Shares, and Limits

A WLM configuration is an implementation of a resource-management policy. Running WLM in passive mode provides information that helps you determine whether your resource-management policy is reasonable for the given workload. You can now define tiers, shares, and limits to regulate your workload based on your resource-management policy.

For this scenario, assume you have the following requirements:

  • The System class must have the highest priority and be guaranteed access to a percentage of system resources at all times.

  • The SysTools class must have access to a certain percentage of resources at all times, but not so much that it will significantly impact the applications that are running in DeptA and DeptB.

  • The SysBatch class cannot interfere with any of the other work on the system.

  • DeptA will receive 60% of the available resources (meaning resources that are available to the classes with shares) and DeptB will receive 40%. Within DeptA and DeptB: – Processes in the Listen class must respond to requests with a low latency, but must not consume a lot of resources. – The Work class must be allowed to consume the most resources. The Monitor and Command classes must consume some resource, but less than the Work class. – The Report class cannot interfere with any of the other work.

In the following procedure, you define tiers, shares, and limits:

  1. To create the superclass tiers, use your favorite editor to modify the /etc/wlm/MyConfig/classes file to contain the following:

(17줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

The SysBatch superclass is put in tier 1 because this class contains very low-priority jobs that you do not want to interfere with the rest of the work on the system. (When a tier is not specified, the class defaults to tier 0.) Administration of each department's superclass is defined by the adminuser and authuser attributes. The inheritance attribute is enabled for DeptA and DeptB. All new processes started in a class with inheritance will remain classified in that class.

  1. To create subclass tiers for each group of jobs, modify the /etc/wlm/MyConfig/DeptA/classes and /etc/wlm/MyConfig/DeptB/classes files to contain the following:
text
Listen:
Work:
Monitor:
Report:
        tier = 1
Command:
  1. To assign the initial shares for the superclasses, edit the /etc/wlm/MyConfig/shares file to contain the following:
text
DeptA:
        CPU = 3
        memory = 3
DeptB:
        CPU = 2
        memory = 2

Because you assigned a CPU total of 5 shares, DeptA processes will have access to three out of five shares (or 60%) of the total CPU resources and DeptB processes will have access to two out of five (or 40%). Because you did not assign shares to the SysTools, System, and Default classes, their consumption targets will remain independent from the number of active shares, which gives them higher-priority access to resources than the DeptA and DeptB (until their limit is reached). You did not assign the SysBatch class any shares because it is the only superclass in tier 1, and therefore any share assignment is irrelevant. Jobs in the SysBatch class can only consume resources that are unused by all classes in tier 0.

  1. To assign the initial shares for the subclasses, edit the /etc/wlm/MyConfig/DeptA/shares and /etc/wlm/MyConfig/DeptB/shares files to contain the following:
text
Work:
        CPU = 5
        memory = 5
Monitor:
        CPU = 4
        memory = 1
Command:
        CPU = 1
        memory = 1

Because you did not assign shares to the Listen class, it will have the highest-priority access (in the superclass) to resources when it requires them. You assigned the largest number of shares to the Work class because it has the greatest resource requirements. Accordingly, you assigned shares to the Monitor and Command classes based on their observed behavior and relative importance. You did not assign shares to the Report class because it is the only subclass in tier 1, and therefore any share assignment is irrelevant. Jobs in the Report class can only consume resources that are unused by subclasses in tier 0. In the following step of this example, you assign limits to classes that were not assigned shares. (You can also assign limits to classes with shares. See Managing Resources with WLM for more information.)

  1. To assign limits to the superclasses, edit the /etc/wlm/MyConfig/limits file to contain the following:
text
Default:
        CPU = 0%-10%;100%
        memory = 0%-10%;100%
SysTools:
        CPU = 0%-10%;100%
        memory = 0%-5%;100%
System:
        CPU = 5%-50%;100%
        memory = 5%-50%;100%

You assigned soft maximum limits to the System, SysTools, and Default classes to prevent them from significantly interfering with other work on the system. You assigned minimum limits to the System class for CPU and memory because this class contains processes that are essential to system operation, and it must be able to consume a guaranteed amount of resource.

  1. To assign limits to the subclasses, edit the /etc/wlm/MyConfig/DeptA/limits and /etc/wlm/MyConfig/ DeptB/limits files to contain the following:
text
Listen:
        CPU = 10%-30%;100%
        memory = 10%-20%;100%
Monitor:
        CPU = 0%-30%;100%
        memory = 0%-30%;100%

Note: The limits can be different for each subclass file. You assigned soft maximum limits to the Listen and Monitor classes to prevent them from significantly interfering with the other subclasses in the same superclass. In particular, you do not want the system to continue accepting requests for jobs within the Work class, if the Work class does not have access to the resources to process them. You also assigned minimum limits to the Listen class to ensure fast response time. The minimum limit for memory ensures that pages used by this class will not be stolen by page replacement, resulting in faster execution time. The minimum limit for CPU ensures that when these processes can be run, they will have the highest-priority access (in the superclass) to the CPU resources.

Step 3. Fine-tune the Workload Manager configuration

  1. Monitor the system using the wlmstat command and verify that the regulation done by WLM aligns with your goals and does not unduly deprive some applications of resources while others get more than they should. If this is the case, adjust the shares and refresh WLM.

  2. As you monitor and adjust the shares, limits, and tier numbers, decide whether you want to delegate the administration for the subclasses for some or all of the superclasses. The administrator can then monitor and set up the subclass shares, limits, and tier number.

The administrator of each superclass can repeat this process for the subclasses of each superclass. The only difference is that WLM cannot run in passive mode at the subclass level only. The subclass

configuration and tuning has to be done with WLM in active mode. One way not to impact users and applications in the superclass is to start the tier number, and the shares and limits for the subclasses at their default value ('-' (hyphen) for shares, 0% for minimum, and 100% for soft and hard maximum). With these settings, WLM will not regulate the resource allocation between the subclasses.

For more information

  • Workload Manager.

  • Workload Management.

  • Workload Management Diagnosis in Performance management.

  • Analyzing WLM with wlmperf in Performance Toolbox Version 3: Guide and Reference.

  • The descriptions for the classes, limits, rules, and shares files in the Files Reference.

  • The topas, wlmassign, wlmcheck, wlmcntrl, wlmmon, wlmperf, and wlmstat.

  • The WLM subroutine descriptions, especially wlm_set_tag.

Related concepts

Setting up Workload Manager Class definitions, class attributes, the shares and limits, and the automatic class assignment rules, can be entered using Web-based System Manager, SMIT, or the WLM command-line interface. These definitions and rules are kept in plain text files, that can also be created or modified using a text editor.