[AIX 운영 체제와 장치 관리 47] WLM 자원 관리 — 자원 형식, 목표 공유, 자원 한계, 클래스 우선순위, 배타 프로세서 자원 세트(XRSET), 자원 세트 레지스트리, WLM 설정과 문제 해결

핵심 정리

  • WLM은 매초 클래스별 CPU, 물리 메모리(고정 페이지 제외), 디스크 I/O 사용률을 계산하며 CPU와 디스크 I/O는 몇 초에 걸친 감쇠 평균을 씁니다. 디스크 I/O 공유와 한계는 디스크 장치마다 따로 적용됩니다.
  • 목표 비율은 클래스의 공유 수를 그 등급의 활성 공유 수로 나눈 값입니다. 공유를 -로 두면(기본값) 그 자원에 대해 조절하지 않는 클래스가 됩니다. 공유는 1~65535입니다.
  • 비율 한계는 최소(기본 0), 소프트 최대(기본 100), 하드 최대(기본 100)이며 limits 파일에 최소%-소프트최대%;하드최대% 형식으로 씁니다. 등급 안 최소 합은 100을 넘을 수 없습니다.
  • 총량 한계(totalCPU, totalDiskIO, totalConnectTime, totalProcesses, totalThreads, totalLogins)를 넘은 프로세스는 SIGTERM, 5초 뒤 SIGKILL을 받습니다. 우선순위는 하드 한계, 등급, 소프트 한계, 공유 순으로 적용됩니다.
  • XRSET(sysxrset 이름 공간)의 CPU는 명시적으로 보낸 작업만 실행하며 재부팅하면 사라집니다. bindprocessor로는 XRSET CPU에 바인딩할 수 없습니다.
항목 내용
버전 AIX 6.1 (5.3판과 거의 같음)
원문 Operating system and device management — 5.3판 209224쪽, 6.1판 494504쪽
관련 명령어 wlmcntrl, wlmcheck, wlmstat, wlmmon, wlmperf, iostat, ps -o, mkrset, lsrset, rmrset, attachrset, execrset, bindprocessor
관련 파일·API shares, limits, /etc/rsets, /etc/wlm/current, rs_registername(), rs_discardname()

WLM은 시스템에서 활성인 스레드와 프로세스의 자원 사용을 클래스 단위로 감시하고 조절합니다. WLM이 관리하는 자원 형식마다 클래스별 최소 또는 최대 한계를 설정하고, 자원마다 클래스별 목표 값도 설정할 수 있습니다.

이 목표는 클래스 안 작업에 최적인 자원량을 나타냅니다. 수퍼클래스 수준의 공유와 한계는 시스템에서 쓸 수 있는 각 자원 총량을 기준으로 합니다. 서브클래스 수준에서 공유와 한계는 서브클래스가 속한 수퍼클래스가 쓸 수 있는 각 자원량(수퍼클래스 목표)을 기준으로 합니다. 클래스 계층은 시스템 자원을 사용자 그룹(수퍼클래스) 사이에 나누고 이 자원 몫의 관리를 수퍼클래스 관리자에게 위임하는 방법입니다. 그러면 각 수퍼클래스 관리자는 서브클래스를 만들고 서브클래스의 자원 권리를 정의해 이 자원량을 그룹 안 사용자 사이에 다시 나눌 수 있습니다.

워크로드 관리자의 자원 형식

WLM은 세 가지 자원 형식을 비율 소비 기준으로 관리합니다.

자원 설명
클래스 안 스레드의 CPU 사용률 클래스 안 모든 스레드가 쓴 CPU 주기의 합입니다.
클래스 안 프로세스의 물리 메모리 사용률 클래스 안 프로세스에 속한 모든 메모리 페이지의 합입니다.
클래스의 디스크 I/O 대역폭 클래스가 접근하는 각 디스크 장치에서 클래스 안 스레드가 시작한 모든 I/O의 대역폭(초당 512바이트 블록 수)입니다.

WLM은 매초 직전 1초 동안 자원마다 클래스별 사용률을 쓸 수 있는 전체 자원에 대한 비율로 다음과 같이 계산합니다.

  • CPU에서 매초 쓸 수 있는 CPU 시간 총량은 1초에 시스템 CPU 수를 곱한 값입니다. 예를 들어 8웨이 SMP에서 한 클래스의 모든 스레드가 직전 1초 동안 CPU 시간을 합쳐 2초 썼다면 2/8 = 25%입니다. WLM이 조절에 쓰는 비율은 이 "순간" 초당 자원 사용률의 몇 초에 걸친 감쇠 평균입니다.
  • 물리 메모리에서 어느 때든 프로세스가 쓸 수 있는 물리 메모리 총량은 시스템에 물리적으로 있는 메모리 페이지 총수에서 고정(pinned) 페이지 수를 뺀 값입니다. 고정 페이지는 메모리 사용률을 조절하려고 한 클래스에서 빼앗아 다른 클래스에 줄 수 없으므로 WLM이 관리하지 않습니다. 클래스의 메모리 사용률은 클래스 안 모든 프로세스가 가진 고정되지 않은 메모리 페이지 수를 시스템에서 쓸 수 있는 페이지 수로 나눈 비율입니다.
  • 디스크 I/O에서 핵심 문제는 장치에 의미 있는 가용 대역폭을 정하는 것입니다. 디스크가 100% 바쁠 때 초당 블록 수로 잰 처리량은 응용 프로그램 하나가 순차 I/O를 할 때와 여러 응용 프로그램이 무작위 I/O를 낼 때 크게 다릅니다. 순차 I/O에서 잰 최대 처리량만 (장치의 가용 I/O 대역폭 값으로) 써서 무작위 I/O에서의 장치 사용률을 계산하면, 실제로는 100% 사용 중인데 20% 사용 중이라고 잘못 생각할 수 있습니다.

클래스별 디스크 사용률을 더 정확하고 믿을 만하게 얻으려고 WLM은 디스크 드라이버가 제공하는 통계(iostat 명령으로 표시)를 씁니다. 이 통계는 디스크 장치마다 직전 1초 동안 장치가 바빴던 시간 비율을 알려 줍니다. WLM은 직전 1초 동안 장치에 접근한 모든 클래스가 장치에서 읽거나 쓴 전체 블록 수, 클래스마다 읽거나 쓴 블록 수, 장치 사용률을 셉니다. 그런 다음 클래스마다 쓴 디스크 처리량 비율을 계산합니다.

예를 들어 직전 1초 동안 읽거나 쓴 전체 블록 수가 1000이고 장치가 70% 바빴다면, 100블록을 읽거나 쓴 클래스는 디스크 대역폭의 7%를 쓴 것입니다. (또 다른 재생 가능 자원인) CPU 시간과 마찬가지로 WLM이 디스크 I/O 조절에 쓰는 값도 이 초당 비율의 몇 초에 걸친 감쇠 평균입니다.

디스크 I/O 자원에서 공유와 한계는 클래스가 접근하는 각 디스크 장치에 개별로 적용됩니다. 조절은 장치마다 따로 합니다. 그래서 클래스가 한 장치에서는 권리를 넘어 그 장치로 가는 I/O가 조절되는 동안, 다른 디스크에서는 권리 아래여서 그 장치로 가는 I/O는 제약받지 않을 수 있습니다.

WLM은 총소비량 기준의 자원 계정과 조절을 지원합니다. 이 방식으로 조절할 수 있는 자원은 클래스 총량과 프로세스 총량 두 형식입니다.

클래스 총량

클래스 안 프로세스, 스레드, 로그인 세션 수에 클래스별 한계를 지정할 수 있습니다. 이 한계는 어느 순간에 클래스에 있을 수 있는 각 자원의 절대 수로 지정합니다. 이 한계는 엄격히 강제됩니다. 클래스가 이 자원 가운데 하나의 한계에 이르면 그 자원의 인스턴스를 또 만들려는 시도는 모두 실패합니다. 클래스가 그 자원의 지정 한계 아래로 내려갈 때까지 클래스 안 모든 프로세스에서 그 작업은 계속 실패합니다.

프로세스 총량

CPU 시간, 디스크 I/O 블록, 로그인 세션 접속 시간의 총량에 프로세스별 한계를 지정할 수 있습니다. 이 한계는 클래스 수준에서 지정하지만 클래스 안 각 프로세스에 개별로 적용됩니다(각 프로세스가 이만큼 쓸 수 있습니다). 이 소비 값은 누적되므로 프로세스가 평생 동안 쓴 각 자원의 총량을 나타냅니다. 프로세스가 어느 자원의 총량 한계를 넘으면 프로세스는 끝납니다. 프로세스에 SIGTERM 신호를 보내고, 프로세스가 이 신호를 잡고 5초 유예 시간 뒤에도 끝나지 않으면 SIGKILL 신호를 보냅니다. 로그인 세션이 접속 시간 한계의 90%에 이르면 제어 터미널에 경고 메시지를 써서 세션이 곧 끝난다고 사용자에게 알립니다.

워크로드 관리자의 목표 공유

클래스의 목표(원하는) 자원 소비 비율은 특정 자원에 대해 가진 공유 수로 정해집니다.

공유는 클래스가 같은 등급의 다른 클래스에 비해 특정 자원을 얼마나 얻어야 하는지 나타냅니다. 특정 자원에 대한 클래스의 목표 비율은 단순히 그 클래스의 공유 수를 그 등급의 활성 공유 수로 나눈 값입니다. 한계도 쓰면 목표는 [최소, 소프트 최대] 범위로 제한됩니다. 계산한 목표가 이 범위 밖이면 알맞은 상한이나 하한으로 설정됩니다(자원 한계 참조). 활성 공유 수는 활성 프로세스가 적어도 하나 있는 모든 클래스의 공유 총수입니다. 활성 공유 수가 동적이므로 목표도 동적입니다. 클래스가 등급의 유일한 활성 클래스이면 그 목표는 등급이 쓸 수 있는 자원량의 100%입니다.

예를 들어 등급 0에 활성 수퍼클래스 A, B, C가 있고 특정 자원 공유가 각각 15, 10, 5이면 목표는 다음과 같습니다.

  • target(A) = 15/30 = 50%
  • target(B) = 10/30 = 33%
  • target(C) = 5/30 = 17%

얼마 뒤 클래스 B가 비활성(활성 프로세스 없음)이 되면 클래스 A와 C의 목표는 자동으로 조정됩니다.

  • target(A) = 15/20 = 75%
  • target(C) = 5/20 = 25%

보다시피 공유는 스스로 적응하는 비율이어서, 클래스가 활성이나 비활성이 될 때 그 클래스에 할당된 자원을 다른 클래스에 고르게 나눠 주거나 가져올 수 있습니다.

유연성을 높이려고 클래스의 공유 수는 1부터 65535 사이 어떤 수든 될 수 있습니다. 공유는 수퍼클래스와 서브클래스에 지정할 수 있습니다. 수퍼클래스의 공유는 같은 등급의 다른 모든 활성 수퍼클래스에 상대적입니다. 서브클래스의 공유는 같은 수퍼클래스, 같은 등급의 다른 모든 활성 서브클래스에 상대적입니다. 한 수퍼클래스의 서브클래스 공유는 다른 수퍼클래스의 서브클래스 공유와 아무 관계가 없습니다.

클래스의 목표를 활성 공유 수와 무관하게 하고 싶을 때가 있습니다. 이렇게 하려면 공유 수로 "-"를 지정할 수 있습니다. 이 경우 클래스는 그 자원에 대해 조절되지 않습니다. 곧 공유가 없고 목표가 활성 공유 수에 의존하지 않습니다. 목표는 (등급이 쓸 수 있는 자원 - 등급 안 다른 모든 클래스의 최소 합)으로 설정됩니다. 이 목표와 실제 소비 가운데 낮은 쪽을 같은 등급의 다른 클래스가 쓸 수 있는 양에서 뺍니다.

예를 들어 클래스 A, B, C, D의 특정 자원 공유가 각각 "-", 200, 150, 100이라고 합시다. 모든 클래스가 활성이고 클래스 A가 자원의 50%를 쓰고 있습니다.

  • target(A) = 조절 안 함 = 100%
  • target(B) = 200/450 × 가용 = 44% × 50% = 22%
  • target(C) = 150/450 × 가용 = 33% × 50% = 17%
  • target(D) = 100/450 × 가용 = 22% × 50% = 11%

클래스 A가 조절되지 않고 가용 자원의 50%를 쓰므로 다른 클래스는 50%만 쓸 수 있고, 목표는 이 비율을 바탕으로 계산됩니다. 클래스 A는 늘 목표(100%) 아래에 있으므로 같은 등급에서 목표에 이르렀거나 넘은 다른 모든 클래스보다 늘 우선순위가 높습니다(자세한 내용은 워크로드 관리자의 클래스 우선순위 참조).

참고: 클래스를 어떤 자원에 대해 조절하지 않는 것은 더 높은 등급에 두는 것과 같지 않습니다. 다음 동작은 (같은 등급의) 조절하지 않는 클래스에 해당하며, 클래스를 더 높은 등급에 두면 해당하지 않습니다.

  • 공유는 자원마다 정의하므로 클래스는 하나 이상의 자원에 대해서는 조절하지 않고 다른 자원에 대해서는 조절할 수 있습니다.
  • 같은 등급 다른 클래스의 최소 한계가 지켜집니다. 높은 등급은 낮은 등급에 지정한 최소를 지키지 않습니다.
  • 공유가 있는 클래스에 최소 한계가 없더라도, 조절하지 않는 클래스의 소비는 등급이 쓸 수 있는 자원 일부를 두고 경쟁하므로 공유가 있는 클래스에 어느 정도 의존합니다. 주어진 워크로드에서 어떻게 동작하는지 보려면 실험이 좀 필요합니다.

공유 수를 지정하지 않으면 기본값 "-"를 쓰며 클래스는 그 자원에 대해 조절되지 않습니다. WLM 첫 버전에서는 지정하지 않을 때 기본 공유 값이 1이었다는 점에 유의합니다.

공유는 모든 자원 형식에 대해 클래스별로 지정합니다. 공유는 shares 파일의 스탠자에 지정합니다. 예:

text
shares
classname :
   CPU      =   2
   memory   =   4
   diskIO   =   3

워크로드 관리자의 자원 한계 지정

WLM은 공유로 상대적 자원 권리를 정의하는 것과 함께 클래스에 자원 한계를 지정하는 기능도 제공합니다. 자원 한계로 관리자는 자원 할당을 더 잘 제어할 수 있습니다. 이 한계는 비율로 지정하며 클래스가 있는 등급이 쓸 수 있는 자원량에 상대적입니다.

비율 기반 조절의 한계에는 세 종류가 있습니다.

한계 설명
Minimum(최소) 클래스가 쓸 수 있게 해야 할 자원의 최소량입니다. 실제 클래스 소비가 이 값보다 낮으면 클래스는 자원에 가장 높은 우선순위로 접근합니다. 가능한 값은 0~100이며 (지정하지 않으면) 기본값은 0입니다.
Soft Maximum(소프트 최대) 자원 경합이 있을 때 클래스가 쓸 수 있는 자원의 최대량입니다. 클래스 소비가 이 값을 넘으면 클래스는 등급 안에서 가장 낮은 우선순위를 받습니다. (같은 등급 다른 클래스와의) 자원 경합이 없으면 클래스는 원하는 만큼 쓸 수 있습니다. 가능한 값은 1~100이며 (지정하지 않으면) 기본값은 100입니다.
Hard Maximum(하드 최대) 경합이 없을 때도 클래스가 쓸 수 있는 자원의 최대량입니다. 클래스가 이 한계에 이르면 소비 비율이 한계 아래로 내려갈 때까지 자원을 더 쓸 수 없습니다. 가능한 값은 1~100이며 (지정하지 않으면) 기본값은 100입니다.

자원 한계 값은 자원 한계 파일에 클래스마다 스탠자 안에서 자원 형식별로 지정합니다. 한계는 최소에서 소프트 최대까지의 범위로 지정하며 하이픈(-)으로 구분하고 공백은 무시합니다. 하드 최대를 지정하면 소프트 최대 뒤에 세미콜론(;)으로 구분해 둡니다. 각 한계 값 뒤에는 퍼센트 기호(%)를 붙입니다.

다음은 rules 파일을 쓰는 예입니다.

  • acct3 그룹의 사용자 joe가 /bin/vi를 실행하면 프로세스는 수퍼클래스 acctg에 들어갑니다.
  • dev 그룹의 사용자 sue가 /bin/emacs를 실행하면 프로세스는 (그룹 ID가 맞아) 수퍼클래스 devlt에 들어가지만, 사용자 sue가 editors 서브클래스에서 제외돼 있으므로 그 서브클래스로는 분류되지 않습니다. 프로세스는 devlt.Default로 갑니다.
  • DB 관리자가 데이터베이스 DB1을 서비스하려고 사용자 ID oracle, 그룹 ID dbm으로 /usr/sbin/oracle을 시작하면 프로세스는 default 수퍼클래스로 분류됩니다. 프로세스가 태그를 _DB1로 설정해야만 수퍼클래스 db1에 할당됩니다.

한계는 모든 자원 형식에 대해 클래스별로 limits 파일의 스탠자에 지정합니다. 예:

text
shares
classname :
   CPU     =   0%-50%;80%
   memory  =   10%-30%;50%

이 예에서는 디스크 I/O 한계를 설정하지 않았습니다. 시스템 기본값을 쓰면 다음과 같이 됩니다.

text
diskIO   =   0%-100%;100%

앞의 예는 모두 설명한 수퍼클래스와 서브클래스에 상속 속성이 yes로 설정되지 않았다고 가정합니다. 그렇지 않으면 새 프로세스는 부모의 수퍼클래스나 서브클래스를 그대로 물려받습니다.

WLM이 자원 한계 값에 두는 제약은 다음뿐입니다.

  • 최소 한계는 소프트 최대 한계보다 작거나 같아야 합니다.
  • 소프트 최대 한계는 하드 최대 한계보다 작거나 같아야 합니다.
  • 한 등급 안 모든 수퍼클래스의 최소 합은 100을 넘을 수 없습니다.
  • 한 등급 안에서 주어진 수퍼클래스의 모든 서브클래스의 최소 합은 100을 넘을 수 없습니다.

하드 메모리 한계가 있는 클래스가 한계에 이르러 페이지를 더 요청하면, VMM 페이지 교체 알고리즘(LRU)이 시작돼 새 페이지를 내주기 전에 제한된 클래스에서 페이지를 "빼앗아" 페이지 수를 하드 최대 아래로 낮춥니다. 이 동작은 올바르지만, 빈 페이지가 넉넉할 때도 일어날 수 있는 추가 페이징 활동은 시스템 전반 성능에 영향을 줍니다. 어떤 클래스에 하드 메모리 최대를 두기 전에 다른 클래스에 최소 메모리 한계를 두는 것이 좋습니다.

최소 아래에 있는 클래스는 등급 안에서 가장 높은 우선순위를 가지므로, 같은 등급 다른 클래스의 자원 요구를 바탕으로 최소 합을 적당한 수준으로 유지해야 합니다.

등급 안 최소 한계 합이 100 이하라는 제약은 가장 높은 우선순위 등급의 클래스가 늘 최소 한계까지 자원을 얻을 수 있다는 뜻입니다. WLM은 클래스가 실제로 최소 한계에 이른다고 보장하지는 않습니다. 클래스 안 프로세스가 자원을 어떻게 쓰는지와 적용 중인 다른 한계에 달려 있습니다. 예를 들어 클래스가 메모리를 충분히 얻지 못해 최소 CPU 권리에 이르지 못할 수 있습니다.

물리 메모리에서 최소 메모리 한계를 설정하면 클래스 프로세스의 메모리 페이지를 (적어도 가장 높은 우선순위 등급에서는) 어느 정도 보호합니다. 클래스가 최소 한계 아래에 있을 때는 모든 활성 클래스가 최소 한계 아래이고 그 가운데 하나가 페이지를 더 요청하는 경우가 아니면 페이지를 빼앗기지 않아야 합니다. 가장 높은 등급의 클래스는 최소 아래에 있을 때 페이지를 빼앗기지 않아야 합니다. 대화형 작업 클래스에 메모리 최소 한계를 설정하면 (메모리가 빠듯할 때도) 연속한 활성화 사이에 페이지를 모두 빼앗기지 않게 해 응답 시간이 좋아집니다.

주의: 하드 최대 한계를 알맞게 쓰지 않으면 시스템이나 응용 프로그램 성능에 큰 영향을 줄 수 있습니다. 하드 한계를 두면 시스템 자원이 쓰이지 않고 남을 수 있으므로 대부분의 경우 소프트 최대 한계가 더 알맞습니다. 하드 최대 한계의 한 가지 쓰임은 높은 등급의 소비를 제한해 낮은 등급이 자원을 좀 쓸 수 있게 하는 것이지만, 자원이 필요한 응용 프로그램을 높은 등급에 두는 것이 더 나은 해결책일 수 있습니다.

총량 한계는 다음 표에 요약한 값과 단위로 limits 파일에 지정할 수 있습니다.

표 69. 워크로드 관리자의 자원 한계

자원 허용 단위 기본 단위 최댓값 최솟값
totalCPU s, m, h, d, w s 2^30 – 1초 10초
totalDiskIO KB, MB, TB, PB, EB KB (2^63 – 1) × 512/1024KB 1MB
totalConnectTime s, m, h, d, w s 2^63 – 1초 5분
totalProcesses – – 2^63 – 1 2
totalThreads – – 2^63 – 1 2
totalLogins – – 2^63 – 1 1

참고: 단위 지정자는 대소문자를 구분하지 않습니다. s = 초, m = 분, h = 시, d = 일, w = 주, KB = 킬로바이트, MB = 메가바이트 등입니다.

다음은 limits 스탠자 예입니다.

text
BadUserClass:
     totalCPU = 1m
     totalConnectTime = 1h

총량 한계는 위 표의 어떤 값으로든 지정할 수 있으며 다음 제한이 있습니다.

  • 지정하면 totalThreads 값은 적어도 totalProcesses 값 이상이어야 합니다.
  • totalThreads를 지정하고 totalProcesses를 지정하지 않으면 totalProcesses 한계는 totalThreads 값으로 설정됩니다.

총량 한계는 수퍼클래스와 서브클래스 수준에 지정할 수 있습니다. 한계를 확인할 때는 서브클래스 한계를 수퍼클래스 한계보다 먼저 확인합니다. 두 한계를 모두 지정하면 낮은 쪽이 강제됩니다. 지정한 서브클래스 한계가 연결된 수퍼클래스 한계보다 크면 구성을 읽을 때 경고가 나오지만 구성은 읽힙니다. 클래스 총량 한계는 (수퍼클래스에 상대적이지 않은) 절대값이어서 서브클래스 하나가 수퍼클래스가 쓸 수 있는 자원을 다 쓸 수 있으므로 이 점이 중요합니다. 지정하지 않으면 모든 총량 한계의 기본값은 한계 없음을 뜻하는 "-"입니다. 기본적으로 WLM이 실행 중이면 클래스와 프로세스 총량 계정과 조절이 켜집니다. 총량 계정과 조절을 끄려면 wlmcntrl 명령의 -T [class|proc] 옵션을 씁니다.

워크로드 관리자의 클래스 우선순위

WLM은 자원마다 각 클래스에 우선순위를 주어 클래스에 자원을 할당합니다.

클래스 우선순위는 동적이며 클래스의 등급, 공유, 한계, 현재 소비를 바탕으로 합니다. 어느 때든 가장 높은 우선순위의 클래스가 자원에 우선 접근합니다. 가장 높은 수준에서 등급은 겹치지 않는 클래스 우선순위 범위를 나타냅니다. 등급 0의 클래스는 (하드 최대를 넘지 않는 한) 늘 등급 1의 클래스보다 높은 우선순위가 보장됩니다.

클래스 우선순위를 정할 때 WLM은 다음 우선 순서(높은 것부터 낮은 것)로 제약을 강제합니다.

제약 설명
hard limits(하드 한계) 클래스 소비가 어떤 자원의 하드 최대를 넘으면 클래스는 그 자원에 대해 가장 낮은 우선순위를 받고, 소비가 한계 아래로 내려갈 때까지 접근이 거부됩니다.
tier(등급) 하드 한계가 없으면 클래스 우선순위는 그 등급에 허용되는 최소·최대 우선순위 안에 묶입니다.
soft limits(소프트 한계) 클래스 소비가 어떤 자원의 최소 한계보다 낮으면 클래스는 등급 안에서 가장 높은 우선순위를 받습니다. 클래스 소비가 소프트 최대보다 높으면 등급 안에서 가장 낮은 우선순위를 받습니다.
shares(공유) 자원마다 클래스 소비 목표를 계산하는 데 씁니다. 클래스 소비가 목표 아래로 내려가면 우선순위가 올라가고 목표 위로 올라가면 내려갑니다. 소프트 한계가 더 우선하므로 해당하면 소프트 한계를 바탕으로 클래스 우선순위가 정해집니다.

클래스와 자원마다 공유와 한계를 모두 쓸 수 있지만, 클래스마다 둘 가운데 하나만 쓰면 결과를 더 잘 예측할 수 있습니다.

배타 사용 프로세서 자원 세트

배타 사용 프로세서 자원 세트(XRSET)로 관리자는 중요한 작업에 자원을 보장할 수 있습니다. XRSET은 포함한 모든 CPU의 동작을 바꾸는 이름 붙은 자원 세트입니다. CPU가 배타 사용이 되면 그 CPU로 명시적으로 보낸 프로그램만 실행합니다.

XRSET 만들기

XRSET을 만들려면 root 사용자여야 합니다. mkrset 명령으로 sysxrset 이름 공간에 자원 세트를 만듭니다. 예를 들어 mkrset -c 1-3 sysxrset/set1 명령은 CPU 1, 2, 3으로 XRSET을 만듭니다. rs_registername() 서브루틴으로도 XRSET을 만들 수 있습니다.

시스템에 XRSET이 정의됐는지 확인

lsrset -v -n sysxrset 명령은 시스템에 정의된 모든 XRSET을 표시합니다. (지금은 이를 위한 프로그래밍 API가 없습니다.)

XRSET 지우기

XRSET을 지우려면 root 사용자여야 합니다. rmrset 명령이 XRSET을 지웁니다. rs_discardname() 서브루틴으로도 XRSET을 지울 수 있습니다.

시스템 재부팅

시스템을 다시 부팅하면 설정된 XRSET은 레지스트리에서 지워져 더는 적용되지 않습니다.

XRSET용 작업 지정

작업이 배타 사용 프로세서를 쓸 수 있도록 표시하는 방법은 여러 가지입니다. attachrset과 execrset 명령으로 배타 사용 프로세서가 든 자원 세트를 지정할 수 있습니다. 배타 사용 프로세서가 든 자원 세트를 WLM 클래스와 연결할 수 있습니다. 그런 WLM 클래스로 분류된 작업은 자원 세트에 지정한 배타 사용 프로세서를 씁니다.

bindprocessor와 _system_configuration.ncpus에서 XRSET 쓰기

bindprocessor로는 작업을 배타 사용 프로세서에서 실행하게 할 수 없습니다. 자원 세트 기반 연결만 작업을 배타 사용 프로세서에서 실행하게 할 수 있습니다.

XRSET을 만들어도 시스템 구성의 CPU 수(_system_configuration.ncpus 필드)는 바뀌지 않습니다. 시스템에는 여전히 NCPUs개의 CPU가 있습니다.

프로그램이 bindprocessor 시스템 호출로 NCPUs에 바인딩할 때 XRSET 안 CPU는 EINVAL 오류로 실패합니다. bindprocessor 명령의 조회 옵션이 돌려주는 어떤 ID에든 바인딩할 수 있습니다. 조회 옵션(bindprocessor -q)은 배타 CPU와 연결된 것을 뺀 유효한 바인드 ID만 돌려줍니다.

예를 들어 시스템에 온라인 CPU가 10개 있고 그 가운데 3개가 XRSET에 있으면, 바인드 ID 06인 CPU로의 bindprocessor는 성공합니다. 바인드 ID 79인 CPU로의 bindprocessor는 EINVAL 오류를 받습니다.

동적 CPU 재구성 작업에서 XRSET 쓰기

일반적으로 동적 CPU 재구성은 배타 사용 프로세서의 영향을 받지 않습니다. 그러나 XRSET을 만들고 그 프로세서에 작업을 할당하면 CPU 제거가 막힐 수 있습니다. 시스템에 동적으로 더한 CPU는 일반 사용이나 배타 사용 프로세서로 시스템에 들어올 수 있습니다. 시스템에 들어올 때 그 논리 CPU ID를 포함한 XRSET이 있으면 배타 사용으로 들어옵니다.

워크로드 관리자의 자원 세트

WLM은 자원 세트(rset)로 주어진 클래스의 프로세스를 시스템 물리 자원의 부분 집합으로 제한합니다. WLM에서 관리하는 물리 자원은 메모리와 프로세서입니다. 유효한 자원 세트는 메모리와 적어도 프로세서 하나로 이루어집니다.

시스템 관리자는 SMIT나 Web-based System Manager로 시스템에서 쓸 수 있는 자원의 부분 집합이 든 자원 세트를 정의하고 이름을 붙일 수 있습니다. 그런 다음 WLM 관리 인터페이스로 root 사용자나 지정된 수퍼클래스 관리자가 자원 세트 이름을 WLM 클래스의 rset 속성으로 쓸 수 있습니다. 그때부터 이 WLM 클래스에 할당된 모든 프로세스는 자원 세트 안 프로세서 가운데 하나에서만 디스패치되어 CPU 자원 면에서 워크로드를 효과적으로 분리합니다.

현재 시스템은 모두 모든 자원 세트가 공유하는 메모리 도메인이 하나뿐이므로 이 방법으로는 메모리에서 워크로드를 물리적으로 분리하지 못합니다.

워크로드 관리자의 자원 세트 레지스트리

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

이름 충돌 위험을 줄이려고 레지스트리는 2단계 이름 체계를 지원합니다. 자원 세트 이름은 name_space/rset_name 형식입니다. name_space와 rset_name은 각각 255자까지이고 대소문자를 구분하며 영문 대소문자, 숫자, 밑줄, 마침표(.)만 쓸 수 있습니다. name_space sys는 운영 체제가 예약해 시스템 자원을 나타내는 rset 정의에 씁니다.

rset 정의 이름은 레지스트리 이름 공간 안에서 고유합니다. 기존 rset 정의와 같은 이름으로 레지스트리에 새 rset 정의를 더하면, 알맞은 권한과 특권이 있을 때 기존 정의가 새 정의로 바뀝니다. root만 SMIT나 Web-based System Manager로 자원 세트를 만들고 수정하고 지우고 메모리 안 rset 데이터베이스를 갱신할 수 있습니다.

각 rset 정의에는 소유자(사용자 ID), 그룹(그룹 ID), 접근 권한이 딸려 있습니다. 이는 rset 정의를 만들 때 지정하며 접근 제어용입니다. 파일처럼 소유자, 그룹, 기타에 대해 읽기와 쓰기 권한을 줬는지 정하는 접근 권한이 따로 있습니다. 읽기 권한은 rset 정의를 가져오게 하고, 쓰기 권한은 rset 정의를 수정하거나 지우게 합니다.

시스템 관리자가 정의한 rset 정의는 /etc/rsets 스탠자 파일에 보관됩니다. 이 파일 형식은 설명하지 않으며, 나중에 파일 형식이 바뀌어도 호환성 문제가 생기지 않도록 사용자는 SMIT나 Web-based System Manager 인터페이스로 rset을 다뤄야 합니다. WLM 클래스 정의와 마찬가지로 rset 정의도 WLM이 쓰기 전에 커널 데이터 구조로 읽어 들여야 합니다.

관련 작업

  • 자원 세트 만들기 — 자원 세트(rset)를 쓰면 CPU에 관해 워크로드를 서로 효과적으로 격리할 수 있습니다. 서로 다른 워크로드 둘을 클래스 둘로 나누고 클래스마다 서로 다른 CPU 부분 집합을 주면 두 워크로드가 CPU 자원을 다투지 않게 할 수 있습니다.
영어 원문

Resource management with Workload Manager

WLM monitors and regulates the resource utilization, on a per-class basis, of the threads and processes active on the system. You can set minimum or maximum limits per class for each resource type managed by WLM, as well as a target value per class for each resource.

This target is representative of the amount of the resource that is optimal for the jobs in the class. The shares and limits at the superclass level refer to the total amount of each resource available on the system. At the subclass level, shares and limits refer to the amount of each resource made available to the superclass that the subclass is in (superclass target). The hierarchy of classes is a way to divide the system resources between groups of users (superclasses) and delegate the administration of this share of the resources to superclass administrators. Each superclass administrator can then redistribute this amount of resources between the users in the group by creating subclasses and defining resource entitlements for these subclasses.

Resource types in Workload Manager

WLM manages three types of resources on a percentage consumption basis.

  • CPU utilization of the threads in a

class This is the sum of all the CPU cycles consumed by every thread in the class.

Physical memory utilization for the processes in a class This is the sum of all the memory pages which belong to the processes in the class.

Disk I/O bandwidth for the class This is the bandwidth (in 512-byte blocks per second) of all the I/Os started by threads in the class on each disk device accessed by the class.

Every second, WLM calculates the per-class utilization for each resource during the last second, as a percentage of the total resource available, as follows:

  • For the CPU, the total amount of CPU time available every second is equal to 1 second times the number of CPUs on the system. For instance, on an eight-way SMP, if all the threads of a class combined consumed 2 seconds of CPU time during the last second, this represents a percentage of 2/8 = 25%. The percentage used by WLM for regulation is a decayed average over a few seconds of this "instantaneous" per-second resource utilization.

  • For physical memory, the total amount of physical memory available for processes at any given time is equal to the total number of memory pages physically present on the system minus the number of pinned pages. Pinned pages are not managed by WLM because these pages cannot be stolen from a class and given to another class to regulate memory utilization. The memory utilization of a class is the ratio of the number of non-pinned memory pages owned by all the processes in the class to the number of pages available on the system, expressed as a percentage.

  • For disk I/O, the main problem is determining a meaningful available bandwidth for a device. When a disk is 100% busy, its throughput, in blocks per second, is very different if one application is doing sequential I/Os than if several applications are generating random I/Os. If you only used the maximum throughput measured for the sequential I/O case (as a value of the I/O bandwidth available for the device) to compute the percentage of utilization of the device under random I/Os, you might be misled to think that the device is at 20% utilization, when it is in fact at 100% utilization.

To get more accurate and reliable percentages of per-class disk utilization, WLM uses the statistics provided by the disk drivers (displayed using the iostat command) giving for each disk device the percentage of time that the device has been busy during the last second. WLM counts the number of total blocks which have been read or written on a device during the last second by all the classes accessing the device, and how many blocks have been read or written by each class and what was the percentage of utilization of the device. WLM then calculates the percentage of the disk throughput consumed by each class.

For instance, if the total number of blocks read or written during the last second was 1000 and the device had been 70% busy, this means that a class reading or writing 100 blocks used 7% of the disk bandwidth. Similarly to the CPU time (another renewable resource), the values used by WLM for its disk I/O regulation are also a decayed average over a few seconds of these per second percentages.

For the disk I/O resource, the shares and limits apply to each disk device individually accessed by the class. The regulation is done independently for each device. This means that a class could be over its entitlement on one device, and the I/Os to this device will be regulated while it is under its entitlement on another disk and the I/Os to this other device will not be constrained.

WLM supports accounting and regulation of resources on the basis of total consumption. There are two types of resources that can be regulated in this manner: class totals and process totals.

class totals

Per-class limits can be specified for the number of processes, threads, and login sessions in the class. These limits are specified as the absolute number of each resource that can exist in the class at any instant. These limits are strictly enforced; when a class has reached its limit for one of these resources, any attempt to create another instance of the resource will fail. The operation will continue to fail for any process in the class until the class is below its specified limit for the resource.

process totals

Per-process limits can be specified for the total amount of CPU time, blocks of disk I/O, and connect time for a login session. These limits are specified at the class level, but apply to each process in the class individually (each process can consume this amount). These consumption values are cumulative and thus represent the total amount of each particular resource that has been consumed by the process during its lifetime. Once a process has exceeded its total limit for any resource, the process will be terminated. The process will be sent a SIGTERM signal, and if it catches this signal and does not exit after a 5 second grace period, will be sent a SIGKILL signal. When a login session has reached 90% of its connect time limit, a warning message will be written to the controlling terminal to warn the user that the session will soon be terminated.

Target shares in Workload Manager

The target (or desired) resource consumption percentage for a class is determined by the number of shares it has for a particular resource.

The shares represent how much of a particular resource a class should get, relative to the other classes in its tier. A class's target percentage for a particular resource is simply its number of shares divided by the number of active shares in its tier. If limits are also being used, the target is limited to the range [minimum, soft maximum]. If the calculated target outside this range, it is set to the appropriate upper/lower bound (see Resource Limits). The number of active shares is the total number of shares of all classes that have at least one active process in them. Because the number of active shares is dynamic, so is the target. If a class is the only active class in a tier, its target will be 100% of the amount of resource available to the tier.

For example, assume three active superclasses classes in tier 0—A, B, and C—with shares for a particular resource of 15, 10, and 5, respectively, the targets would be:

target(A) = 15/30 = 50% target(B) = 10/30 = 33% target(C) = 5/30 = 17%

If some time later, class B becomes inactive (no active processes), the targets for class A and C will be automatically adjusted:

target(A) = 15/20 = 75% target(C) = 5/20 = 25%

As you can see, the shares represent a self-adapting percentage which allow the resources allocated to a class to be evenly distributed to or taken from the other classes when it becomes active/inactive.

To allow a high degree of flexibility, the number of shares for a class can be any number between 1 and 65535. Shares can be specified for superclasses and subclasses. For superclasses, the shares are relative to all other active superclasses in the same tier. For subclasses, the shares are relative to all other active subclasses in the same superclass, in the same tier. The shares for a subclass one superclass have no relationship to the shares for a subclass of another superclass.

In some cases, it might be desirable to make the target for a class independent from the number of active shares. To accomplish this, a value of "-" can be specified for the number of shares. In this case, the class will be unregulated for that resource, meaning that it has no shares, and its target is not dependent on the number of active shares. Its target will be set to (resource available to the tier - the sum of mins for all other classes in the tier). This target, or actual consumption (whichever is lower) is then taken out of what is available to other classes in the same tier.

For example, assume classes A, B, C, and D have shares for a particular resource of "-", 200, 150, and 100, respectively. All classes are active, and class A is consuming 50% of the resource:

target(A) = unregulated = 100% target(B) = 200/450 * available = 44% * 50% = 22% target(C) = 150/450 * available = 33% * 50% = 17% target(D) = 100/450 * available = 22% * 50% = 11%

Because class A is unregulated and is consuming 50% of the available resource, the other classes only have 50% available to them, and their targets are calculated based on this percentage. Since class A will always be below its target (100%), it will always have a higher priority than all other classes in the same tier that are at or above their targets (see Class priority in Workload Manager for more information).

Note: Making a class unregulated for a resource is not the same as putting it in a higher tier. The following behaviors, listed here, are true for an unregulated class (in the same tier), and are not true if the class is put in a higher tier:

  • Because the shares are defined on a per-resource basis, a class can be unregulated for one or more resources, and regulated for others.

  • The minimum limits for other classes in the same tier are honored. Higher tiers do not honor minimums specified in the lower tiers.

  • Even in the absence of minimum limits for the classes with shares, the consumption of unregulated classes is somewhat dependent on classes with shares since they are competing for some of the resource available to the tier. Some experimentation is required to see what the behavior is with a given workload.

If the number of shares is unspecified, a default value of "-" will be used, and the class will be unregulated for that resource. Note that in the first version of WLM, the default share value, if unspecified, was 1.

The shares are specified per class for all the resource types. Shares are specified in stanzas of the shares file. For example:

text
shares
classname :
   CPU      =   2
   memory   =   4
   diskIO   =   3

Resource limit specification in Workload Manager

In addition to using shares to define relative resource entitlements, WLM provides the ability to specify resource limits for a class. Resource limits allow the administrator to have more control over resource allocation. These limits are specified as percentages and are relative to the amount of resource available to the tier that the class is in.

There are three type of limits for percentage-based regulation:

Minimum

This is the minimum amount of a resource that should be made available to the class. If the actual class consumption is below this value, the class will be given highest priority access to the resource. The possible values are 0 to 100, with 0 being the default (if unspecified).

Soft Maximum

This is the maximum amount of a resource that a class can consume when there is contention for that resource. If the class consumption exceeds this value, the class will be given the lowest priority in its tier. If there is no contention for the resource (from other classes in the same tier), the class will be allowed to consume as much as it wants. The possible values are 1 to 100, with 100 being the default (if unspecified).

Hard Maximum

This is the maximum amount of a resource that a class can consume, even when there is no contention. If the class reaches this limit, it will not be allowed to consume any more of the resource until its consumption percentage falls below the limit. The possible values are 1 to 100, with 100 being the default (if unspecified).

Resource limit values are specified in the resource limit file by resource type within stanzas for each class. The limits are specified as a minimum to soft maximum range, separated by a hyphen (-) with white space ignored. The hard maximum when specified follows the soft maximum, and is separated by a semicolon (;). Each limit value is followed by a percent sign (%).

The following are examples using the rules files:

  • If user joe from group acct3 executes /bin/vi, then the process will be put in superclass acctg.

  • If user sue from group dev executes /bin/emacs, then the process will be in the superclass devlt (group ID match), but will not be classified into the editors subclass, because user sue is excluded from that class. The process will go to devlt. Default.

  • When a DB administrator starts /usr/sbin/oracle with a user ID of oracle and a group ID of dbm, to serve the database DB1, the process is classified in the default superclass. Only when the process sets its tag to _DB1 will it be assigned to superclass db1.

Limits are specified for all resource types, per class, in stanzas of the limits file. For example:

text
shares
classname :
   CPU     =   0%-50%;80%
   memory  =   10%-30%;50%

In this example, no limits are set for disk I/O. Using the system defaults, this translates to the following:

text
diskIO   =   0%-100%;100%

All of the preceding examples assume that the superclasses and subclasses described do not have the inheritance attribute set to yes. Otherwise, the new processes would simply inherit the superclass or subclass from their parent.

The following are the only constraints that WLM places on resource limit values:

  • The minimum limit must be less than or equal to the soft maximum limit.

  • The soft maximum limit must be less than or equal to the hard maximum limit.

  • The sum of the minimum of all the superclasses within a tier cannot exceed 100.

  • The sum of the minimum of all the subclasses of a given superclass within a tier cannot exceed 100.

When a class with a hard memory limit has reached this limit and requests more pages, the VMM page replacement algorithm (LRU) is initiated and "steals" pages from the limited class, thereby lowering its number of pages below the hard maximum, before handing out new pages. This behavior is correct, but extra paging activity, which can take place even where there are plenty of free pages available, impacts the general performance of the system. Minimum memory limits for other classes are recommended before imposing a hard memory maximum for any class.

Because classes under their minimum have the highest priority in their tier, the sum of the minimums should be kept to a reasonable level, based on the resource requirements of the other classes in the same tier.

The constraint of the sum of the minimum limits within a tier being less than or equal to 100 means that a class in the highest priority tier is always allowed to get resources up to its minimum limit. WLM does not guarantee that the class will actually reach its minimum limit. This depends on how the processes in

the class use their resources and on other limits that are in effect. For example, a class might not reach its minimum CPU entitlement because it cannot get enough memory.

For physical memory, setting a minimum memory limit provides some protection for the memory pages of the class's processes (at least for those in the highest priority tier). A class should not have pages stolen when it is below its minimum limit unless all the active classes are below their minimum limit and one of them requests more pages. A class in the highest tier should never have pages stolen when it is below its minimum. Setting a memory minimum limits for a class of interactive jobs helps make sure that their pages will not all have been stolen between consecutive activations (even when memory is tight) and improves response time.

Attention: Using hard maximum limits can have a significant impact on system or application performance if not used appropriately. Because imposing hard limits can result in unused system resources, in most cases, soft maximum limits are more appropriate. One use for hard maximum limits might be to limit the consumption of a higher tier to make some resource available to a lower tier, though putting applications that need resources in the higher tier may be a better solution.

The total limits can be specified in the limits file with values and units summarized in the following table:

Table 69. Resource Limits for Workload Manager

Resource Allowed Units Default Unit Maximum Value Minimum Value
totalCPU s, m, h, d, w s 230 – 1s 10 s
totalDiskIO KB, MB, TB, PB, EB KB (263 – 1) * 512/1024 KB 1 MB
totalConnectTime s, m, h, d, w s 263 – 1 s 5 m
totalProcesses – – 263 – 1 2
totalThreads – – 263 – 1 2
totalLogins – – 263 – 1 1

Note: The unit specifiers are not case sensitive. s = seconds, m = minutes, h = hours, d = days, w = weeks, KB = kilobytes, MK = megabytes, ... etc.

An example limits stanza follows:

text
BadUserClass:
     totalCPU = 1m
     totalConnectTime = 1h

The total limits can be specified using any value in the above table with the following restrictions:

  • If specified, the value for totalThreads must be at least the value of totalProcesses.

  • If totalThreads is specified and totalProcesses is not, the limit for totalProcesses will be set to the value of totalThreads.

The total limits can be specified at the superclass and subclass level. When checking the limits, the subclass limit is checked before the superclass limit. If both limits are specified, the lower of the two is enforced. If the specified subclass limit is greater than its associated superclass limit, a warning will be issued when the configuration is loaded, but it will be loaded. This is significant for the class total limits since the limit is absolute (not relative to the superclass) and one subclass could consume all resources available to the superclass. If unspecified, the default value for all total limits is "-" which means no limit. By default, class and process total accounting and regulation will be enabled when WLM is running. The -T [class|proc] option of the wlmcntrl command can be used to disable total accounting and regulation.

Class priority in Workload Manager

WLM allocates resources to classes by giving a priority to each class for each resource.

The priority of a class is dynamic and is based on the tier, shares, limits, and the current consumption of the class. At any given time, the highest priority class or classes will be given preferential access to resources. At the highest level, tiers represent non-overlapping ranges of class priority. Classes in tier 0 will always be guaranteed to have a higher priority than classes in tier 1 (unless over hard maximum).

When determining class priority, WLM enforces its constraints with the following precedence (highest to lowest):

hard limits

If class consumption exceeds the hard maximum for a resource, the class is given the lowest-possible priority for the resource and will be denied access until its consumption falls below this limit.

tier In the absence of hard limits, a class's priority will be bounded by the minimum and maximum allowed priority for its tier.

soft limits

If class consumption is below the minimum of the soft maximum limits for a resource, the class is given the highest-priority in the tier. If class consumption is above the soft maximum, the class is given the lowest-priority in the tier.

shares These are used to calculated the class consumption targets for each resource. The class priority is increased as class consumption falls below the target, and is decreased as it rises above the target. Note that soft limits have higher precedence and the class's priority will be determined based on them, when applicable.

Even though both shares and limits can be used for each class and for each resource, results are more predictable if only one or the other is used per class.

Exclusive use processor resource sets

Exclusive use processor resource sets (XRSETs) allow administrators to guarantee resources for important work. An XRSET is a named resource set that changes the behavior of all the CPUs that it includes. Once a CPU is exclusive, it only runs programs explicitly directed to it.

Creating an XRSET

You must be a root user to create an XRSET. Use the mkrset command to create a resource set in the sysxrset namespace. For example, the command mkrset -c 1-3 sysxrset/set1 creates an XRSET for CPUs 1, 2, and 3. The rs_registername() subroutine can also be used to create an XRSET.

Determining if XRSETs have been Defined on a System

The lsrset -v -n sysxrset command displays all XRSETs defined on a system. (There is currently no programming API to do this.)

Deleting an XRSET

You must be a root user to delete an XRSET. The rmrset command deletes an XRSET. The rs_discardname() subroutine may also be used to delete an XRSET.

Rebooting the System

When you reboot the system, any XRSETs that were set are removed from the registry and are no longer in effect.

Specifying Work for XRSETs

There are multiple ways for work to be marked as eligible to use exclusive use processors. The attachrset and execrset commands can be used to specify resource sets that contain exclusive use processors. Resource sets containing exclusive use processors can be associated with WLM classes. Work classified into such WLM classes will use the exclusive use processors specified in the resource set.

Using XRSETs with Bindprocessor and _system_configuration.ncpus

You cannot use bindprocessor to cause work to run on exclusive use processors. Only resource set-based attachments can cause work to run on exclusive use processors.

The number of CPUs in the system configuration (the _system_configuration.ncpus field) is not changed when XRSETs are created. There are still NCPUs in the system.

When programs use the bindprocessor system call to NCPUs, CPUs in XRSETs will fail with the EINVAL error. You can bind to any ID returned by the query option of the bindprocessor command. The query option (bindprocessor -q) will only return valid bind IDs, excluding those that are associated with exclusive CPUs.

For example, if there are 10 CPUs online in a system and three of them are in XRSETs, a bindprocessor to CPUs with bind IDs in the range of 0 to 6 will succeed. A bindprocessor to CPUs with bind IDs in the range of 7 to 9 will receive an EINVAL error.

Using XRSETs with Dynamic CPU Reconfiguration Operations

In general, dynamic CPU reconfiguration is not affected by exclusive use processors. However, the creation of XRSETs and assignment of work to those processors may prevent removal of a CPU. CPUs that are dynamically added to the system may enter the system as either general use or exclusive use processors. They will enter the system as exclusive use if there is an XRSET containing the logical CPU ID when it enters the system.

Resource sets in Workload Manager

WLM uses resource sets (or rsets) to restrict the processes in a given class to a subset of the system's physical resources. In WLM, the physical resources managed are the memory and the processors. A valid resource set is composed of memory and at least one processor.

Using SMIT or Web-based System Manager, a system administrator can define and name resource sets containing a subset of the resources available on the system. Then, using the WLM administration interfaces, root user or a designated superclass administrator can use the name of the resource set as the rset attribute of a WLM class. From then on, every process assigned to this WLM class is dispatched only on one of the processors in the resource set, effectively separating workloads for the CPU resource.

All of the current systems have only one memory domain shared by all the resource sets, so this method does not physically separate workloads in memory.

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.

To alleviate the risks of name collisions, the registry supports a two-level naming scheme. The name of a resource set is in the form name_space/rset_name. Both the name_space and rset_name can each be 255 characters in length, are case-sensitive, and may contain only uppercase and lowercase letters, numbers, underscores, and periods (.). The name_space of sys is reserved by the operating system and used for rset definitions that represent the resources of the system.

The rset definition names are unique within the registry name space. Adding a new rset definition to the registry using the same name as an existing rset definition causes the existing definition to be replaced with the new definition, given the proper permission and privilege. Only root can create, modify, and delete resource sets and update the in-core rset database, using SMIT or Web-based System Manager.

Each rset definition has an owner (user ID), group (group ID), and access permissions associated with it. These are specified at the time the rset definition is created and exist for the purpose of access control. As is the case for files, separate access permissions exist for the owner, group and others that define whether

read and/or write permission has been granted. Read permission allows an rset definition to be retrieved while write permission allows an rset definition to be modified or removed.

The rset definitions that are defined by the system administrators are kept in the /etc/rsets stanza file. The format of this file is not described, and users must manipulate rset through the SMIT or Web-based System Manager interfaces to prevent future potential compatibility problems if the file format is modified. As is the case for WLM class definitions, the rset definitions must be loaded into kernel data structures before they can be used by WLM.

Related tasks

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.

워크로드 관리자 설정

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

이 파일(WLM 속성 파일이라 함)은 /etc/wlm의 하위 디렉터리에 보관됩니다. 수퍼클래스와 연결된 서브클래스를 설명하는 파일 묶음이 WLM 구성 하나를 정의합니다. WLM 구성 Config의 파일은 /etc/wlm/Config에 있습니다. 이 디렉터리에는 수퍼클래스용 WLM 매개변수 정의가 있습니다. 파일 이름은 description, classes, shares, limits, rules입니다. 이 디렉터리에는 서브클래스 정의를 보관하는 수퍼클래스 이름의 하위 디렉터리도 있을 수 있습니다. 예를 들어 WLM 구성 Config의 수퍼클래스 Super에 대해 /etc/wlm/Config/Super 디렉터리에는 수퍼클래스 Super의 서브클래스 속성 파일이 있습니다. 파일 이름은 description, classes, shares, limits, rules입니다.

시스템 관리자가 WLM 구성을 정의한 뒤에는 Web-based System Manager, smit wlmmanage 빠른 경로, wlmcntrl 명령으로 그 구성을 활성 구성으로 만들 수 있습니다.

속성 파일 묶음을 여러 개 정의해 서로 다른 워크로드 관리 구성을 정의할 수 있습니다. 이 구성은 보통 /etc/wlm의 하위 디렉터리에 있습니다. 심볼릭 링크 /etc/wlm/current가 현재 구성 파일이 든 디렉터리를 가리킵니다. 이 링크는 WLM이 지정한 구성 파일 묶음으로 시작할 때 wlmcntrl 명령이 갱신합니다.

관련 정보

  • 워크로드 통합을 위한 워크로드 관리자 구성 — WLM으로 시스템에서 작업이 쓰는 자원을 제어할 수 있습니다.

워크로드 관리자 구성을 위한 응용 프로그램 요구

구성 정의의 첫 단계에서는 사용자와 그들의 컴퓨팅 요구, 시스템의 응용 프로그램과 그 자원 요구, 업무 요구(예: 어떤 작업이 결정적이고 어떤 작업에 낮은 우선순위를 줄 수 있는지)를 이해해야 합니다. 이 이해를 바탕으로 수퍼클래스를 정의하고 그다음 서브클래스를 정의합니다.

우선순위 설정은 조직에서 WLM이 어떤 기능을 하느냐에 달려 있습니다. 서버 통합이라면 이미 응용 프로그램, 사용자, 그 자원 요구를 알고 있어 일부 단계를 건너뛰거나 줄일 수 있습니다.

WLM에서는 프로세스를 사용자나 그룹, 응용 프로그램, 형식, 태그, 또는 이 속성의 조합으로 분류할 수 있습니다. WLM은 클래스 사이 자원 사용을 조절하므로, 시스템 관리자는 자원 사용 양상이 같은 응용 프로그램과 사용자를 같은 클래스로 묶어야 합니다. 예를 들어 보통 CPU 시간을 아주 적게 쓰지만 빠른 응답 시간이 필요한 대화형 작업을, 보통 CPU와 메모리를 아주 많이 쓰는 배치형 작업과 나누고 싶을 수 있습니다. OLTP형 트래픽과 데이터 마이닝의 무거운 질의를 나눠야 하는 데이터베이스 환경도 마찬가지입니다.

이 단계는 Web-based System Manager, SMIT, 명령행 인터페이스로 합니다. 처음 몇 번은 Web-based System Manager나 SMIT로 수퍼클래스 정의와 속성 설정을 포함해 첫 WLM 구성을 만드는 단계를 안내받는 것이 좋을 것입니다. 첫 시도에서는 일부 속성만 설정하고 나머지는 기본값으로 둘 수 있습니다. 자원 공유와 한계도 마찬가지입니다. 이 클래스 특성은 모두 나중에 동적으로 바꿀 수 있습니다.

그런 다음 WLM을 수동 모드로 시작하고 분류를 확인하며 응용 프로그램의 자원 사용 양상을 살펴보기 시작할 수 있습니다.

wlmcheck 명령이나 해당 SMIT 또는 Web-based System Manager 메뉴로 구성을 확인합니다. 그런 다음 새로 정의한 구성으로 WLM을 수동 모드로 시작합니다. WLM은 기존 프로세스를 모두(와 그때부터 만들어지는 모든 프로세스를) 분류하고 여러 클래스의 CPU, 메모리, 디스크 I/O 사용 통계를 모으기 시작합니다. WLM은 이 자원 사용을 조절하려 하지 않습니다.

(ps 명령의 -o 플래그로) 여러 프로세스가 시스템 관리자가 예상한 알맞은 클래스로 분류됐는지 확인합니다. 일부 프로세스가 예상대로 분류되지 않으면 할당 규칙을 고치거나 (새 프로세스가 부모와 같은 클래스에 남기를 원하면) 일부 클래스에 상속 비트를 설정하고 WLM을 갱신할 수 있습니다. 이 첫 수준 분류(수퍼클래스)에 만족할 때까지 이 과정을 반복할 수 있습니다.

WLM을 수동 모드로 실행하고 (늘 수동 모드로) 새로 고치는 작업은 위험이 낮고 부담이 적으며 정상 시스템 운영을 방해하지 않고 운영 시스템에서 안전하게 할 수 있습니다. WLM을 활성화하고 새로 고치려면 명령행이나 SMIT 또는 Web-based System Manager에서 wlmcntrl 명령을 부릅니다.

WLM을 수동 모드로 실행해 wlmstat 명령으로 통계를 모읍니다. wlmstat 명령을 일정 간격으로 써서 (수퍼클래스의) 클래스별 자원 사용을 쓸 수 있는 전체 자원의 비율로 표시할 수 있습니다. 그러면 오랜 기간 시스템을 감시해 주요 응용 프로그램의 자원 사용을 살펴볼 수 있습니다.

워크로드 관리자의 등급, 공유, 한계

WLM을 수동 모드로 실행해 모은 데이터와 업무 목표를 바탕으로 각 수퍼클래스에 줄 등급 번호와 여러 클래스에 줄 자원별 공유를 정합니다.

일부 클래스에는 최소 또는 최대 한계를 정의하고 싶을 수 있습니다. 자원 할당 목표에 이르도록 공유와 등급 번호를 조정합니다. 한계는 공유만으로 해결할 수 없는 경우를 위해 남겨 둡니다. 서브클래스를 더해야겠다고 판단할 수도 있습니다.

  • 보통 자원 사용이 적지만 외부 이벤트로 활성화될 때 빠른 응답 시간이 필요한 응용 프로그램에는 최소 한계를 씁니다. 메모리가 빠듯할 때 대화형 작업이 겪는 문제 하나는 비활성 기간 동안 페이지를 빼앗긴다는 것입니다. 클래스가 등급 0에 있으면 메모리 최소 한계로 대화형 작업의 페이지 일부를 보호할 수 있습니다.
  • 자원을 많이 쓰는 낮은 우선순위 작업을 묶어 두려면 최대 한계를 씁니다. 다른 이유로 시스템 자원을 분할하는 것이 아니면, 하드 최대는 주로 메모리 같은 재생 불가능 자원에 의미가 있습니다. 첫 클래스가 썼을 페이지를 높은 우선순위 클래스가 필요로 하면 데이터를 페이징 공간에 써 내는 데 시간이 걸리기 때문입니다. CPU 사용에는 등급이나 소프트 최대를 써서 높은 우선순위 클래스가 곧바로 CPU 시간을 할당받게 할 수 있습니다.

서브클래스의 매개변수를 만들고 조정할 때는 시스템 동작에 만족할 때까지 다른 수퍼클래스의 사용자와 응용 프로그램에 영향을 주지 않도록 주어진 수퍼클래스의 서브클래스에 대해서만 WLM을 새로 고칠 수 있습니다.

업무 필요에 따라 매개변수가 다른 구성을 더 정의할 수도 있습니다. 이때 기존 구성을 복사해 고치면 시간을 아낄 수 있습니다.

워크로드 관리자 구성 다듬기

wlmstat 명령으로 시스템을 감시하고, WLM의 조절이 목표에 맞는지, 어떤 응용 프로그램은 자원을 지나치게 빼앗기고 다른 것은 마땅한 몫보다 많이 얻고 있지 않은지 확인합니다. 그렇다면 공유를 조정하고 WLM을 새로 고칩니다.

공유, 한계, 등급 번호를 감시하고 조정하면서 일부 또는 모든 수퍼클래스의 서브클래스 관리를 위임할지 정합니다. 그러면 관리자가 서브클래스 공유, 한계, 등급 번호를 감시하고 설정할 수 있습니다.

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

영어 원문

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.

These files (called WLM property files) are kept in the subdirectories of /etc/wlm. A set of files describing superclasses and their associated subclasses define a WLM configuration. The files for the WLM Config configuration are in /etc/wlm/Config. This directory contains the definitions of the WLM parameters for the superclasses. The files are named description, classes, shares, limits, and rules. This directory might also contain subdirectories with the name of the superclasses where the subclass definitions are kept. For example, for the superclass Super of the WLM configuration Config, the directory /etc/wlm/Config/Super contains the property files for the subclasses of the superclass Super. The files are named description, classes, shares, limits, and rules.

After a WLM configuration has been defined by the system administrator, it can be made the active configuration using Web-based System Manager, the smit wlmmanage fast path, or the wlmcntrl command.

You can define multiple sets of property files, defining different configurations of workload management. These configurations are usually located in subdirectories of /etc/wlm. A symbolic link /etc/wlm/current points to the directory containing the current configuration files. This link is updated by the wlmcntrl command when WLM starts with a specified set of configuration files.

Related information

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

Application requirements for Workload Manager configuration:

The first phase of defining a configuration requires an understanding of your users and their computing needs, as well as the applications on your system, their resource needs and the requirements of your business (for example, which tasks are critical and which can be given a lower priority). Based on this understanding, you define your superclasses and then your subclasses.

Setting priorities is dependent on what function WLM serves in your organization. In the case of server consolidation, you might already know the applications, the users and their resource requirements, and you might be able to skip or shorten some of the steps.

WLM allows you to classify processes by user or group, application, type, tag, or a combination of these attributes. Because WLM regulates the resource utilization among classes, system administrators should group applications and users with the same resource utilization patterns into the same classes. For

instance, you might want to separate the interactive jobs that typically consume very little CPU time but require quick response time from batch-type jobs that typically are very CPU- and memory-intensive. This is the same in a database environment in which you need to separate the OLTP-type traffic from the heavy-duty queries of data mining.

This step is done using Web-based System Manager, SMIT, or command-line interface. For the first few times, it is probably a good idea to use Web-based System Manager or SMIT to take you through the steps of creating your first WLM configuration, including defining the superclasses and setting their attributes. For the first pass, you can set up some of the attributes and leave the others at their default value. This is the same for the resource shares and limits. All these class characteristics can be dynamically modified at a later time.

You can then start WLM in passive mode, check your classification, and start reviewing the resource utilization patterns of your applications.

Verify your configuration, using the wlmcheck command or the corresponding SMIT or Web-based System Manager menus. Then start WLM in passive mode on the newly defined configuration. WLM will classify all the existing processes (and all processes created from that point on) and start compiling statistics on the CPU, memory, and disk I/O utilization of the various classes. WLM will not try to regulate this resource usage.

Verify that the various processes are classified in the appropriate class as expected by the system administrator (using the -o flag of the ps command). If some of the processes are not classified as you expect, you can modify your assignment rules or set the inheritance bit for some of the classes (if you want the new processes to remain in the same class as their parent) and update WLM. You can repeat the process until you are satisfied with this first level of classification (superclasses).

Running WLM in passive mode and refreshing WLM (always in passive mode) involves low risk, has low overhead operation, and can be done safely on a production system without disturbing normal system operation. To activate and refresh WLM, use the wlmcntrl command, invoked either from the command line or from SMIT or Web-based System Manager.

Run WLM in passive mode to gather statistics by using the wlmstat command. The wlmstat command can be used at regular time intervals to display the per-class resource utilization as a percentage of the total resource available, for superclasses). This allows you to monitor your system for extended periods of time to review the resource utilization of your main applications.

Tiers, shares, and limits in Workload Manager

Using the data gathered from running WLM in passive mode and your business goals, decide which tier number will be given to every superclass and what share of each resource should be given to the various classes.

For some classes, you might want to define minimum or maximum limits. Adjust the shares and tier numbers to reach your resource-allocation goals. Reserve limits for cases that cannot be solved only with shares. Also, you might decide you need to add subclasses.

  • Use minimum limits for applications that typically have low resource usage but need a quick response time when activated by an external event. One of the problems faced by interactive jobs in situations where memory becomes tight is that their pages get stolen during the periods of inactivity. A memory minimum limit can be used to protect some of the pages of interactive jobs if the class is in tier 0.

  • Use maximum limits to contain some resource-intensive, low-priority jobs. Unless you partition your system resources for other reasons, a hard maximum will make sense mostly for a nonrenewable resource such as memory. This is because of the time it takes to write data out to the paging space if a higher priority class needs pages that the first class would have used. For CPU usage, you can use tiers or soft maximum to make sure that if a higher priority class is immediately assigned CPU time.

When creating and adjusting the parameters of subclasses, you can refresh WLM only for the subclasses of a given superclass that do not affect users and applications in the other superclasses, until you are satisfied with the system behavior.

You can also define other configurations with different parameters, according to the needs of the business. When doing so, you can save time by copying and modifying existing configurations.

Fine-tuning the Workload Manager configuration

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.

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.

워크로드 관리자 문제 해결

현재 구성으로 원하는 동작을 얻지 못하면 WLM 구성을 조정해야 할 수 있습니다.

클래스마다 소비 값은 wlmstat, wlmmon, wlmperf 같은 도구로 감시할 수 있습니다. 이 데이터를 모아 분석하면 구성에 어떤 변경이 필요할지 정하는 데 도움이 됩니다. 구성을 갱신한 뒤 wlmcntrl -u 명령으로 활성 WLM 구성을 갱신합니다.

다음 지침은 구성을 어떻게 바꿀지 정하는 데 도움이 됩니다.

  • 등급의 활성 공유 수가 시간에 따라 크게 변하면, 클래스에 어떤 자원의 공유를 주지 않아 활성 공유 수와 무관한 소비 목표를 갖게 할 수 있습니다. 이 기법은 자원에 높은 우선순위 접근이 필요한 중요한 클래스에 쓸모 있습니다.
  • 어떤 자원의 일정량에 접근을 보장해야 하면 최소 한계를 지정합니다. 이 기법은 자원을 많이 쓰지 않지만 외부 이벤트에 빨리 응답해야 하는 대화형 작업에 쓸모 있습니다.
  • 자원 접근을 제한해야 하는데 공유로는 충분히 제어되지 않으면 최대 한계를 지정합니다. 대부분은 소프트 최대 한계로 충분하지만 엄격히 강제하려면 하드 최대를 쓸 수 있습니다. 하드 최대 한계는 시스템 자원을 낭비할 수 있고 메모리 조절에 쓰면 페이징 활동을 늘릴 수 있으므로, 하드 한계를 두기 전에 다른 클래스에 최소 한계를 둬야 합니다.
  • 덜 중요한 작업이 더 중요한 작업을 방해하면 덜 중요한 작업을 낮은 등급에 둡니다. 이 기법은 덜 중요한 작업의 우선순위를 낮춰 더 중요한 작업이 실행 중일 때 가용 자원을 다투지 못하게 합니다.
  • 클래스가 어떤 자원의 소비 목표에 이르지 못하면 다른 자원 경합 때문인지 확인합니다. 그렇다면 경합 중인 자원에 대한 클래스 할당을 바꿉니다.
  • 클래스 안 프로세스의 동작이나 자원 소비가 크게 다르면 클래스를 더 만들어 더 세밀하게 제어합니다. 중요한 응용 프로그램마다 클래스를 따로 만드는 것도 바람직할 수 있습니다.
  • 분석 결과 한 클래스에 필요한 자원이 다른 클래스의 소비에 의존하면 그에 맞게 자원을 다시 할당합니다. 예를 들어 ClassZ에 필요한 자원량이 ClassA가 처리할 수 있는 작업 요청 수에 의존하면, ClassZ가 필요한 것을 제공할 만큼 ClassA가 자원에 접근하도록 보장해야 합니다.
  • 하나 이상의 응용 프로그램이 제대로 동작할 만큼 자원을 꾸준히 받지 못하면 시스템의 워크로드를 줄이는 것이 유일한 방법일 수 있습니다.

참고: 수퍼클래스에 adminuser를 정의해 WLM 관리자에게 필요한 작업량을 줄일 수 있습니다. 최상위 구성을 시험하고 조정한 뒤 이후 변경(서브클래스 만들기와 구성 포함)은 수퍼클래스 adminuser가 자신의 필요에 맞게 할 수 있습니다.

영어 원문

Troubleshooting Workload Manager

If you are not seeing the desired behavior with your current configuration, you might need to adjust your WLM configuration.

The consumption values for each class can be monitored using tools such as wlmstat, wlmmon or wlmperf. This data can be collected and analyzed to help determine what changes might need to be made to the configuration. After you update the configuration, update the active WLM configuration using the wlmcntrl -u command.

The following guidelines can help you decide how to change your configuration:

  • If the number of active shares in a tier varies greatly over time, you can give a class no shares for a resource so it can have a consumption target that is independent from the number of active shares. This technique is useful for important classes that require high-priority access to a resource.

  • If you need to guarantee access to a certain amount of a resource, specify minimum limits. This technique is useful for interactive jobs that do not consume a lot of resources, but must respond quickly to external events.

  • If you need to limit access to resources but shares do not provide enough control, specify maximum limits. In most cases, soft maximum limits are adequate, but hard maximums can be used for strict enforcement. Because hard maximum limits can result in wasted system resources, and they can increase paging activity when used for memory regulation, you should impose minimum limits for the other classes before imposing any hard limits.

  • If less-important jobs are interfering with more-important jobs, put the less-important jobs in a lower tier. This technique ensures less-important jobs have lower priority and cannot compete for available resources while the more-important jobs are running.

  • If a class cannot reach its consumption target for a resource, check whether this condition is caused by contention for another resource. If so, change the class allocation for the resource under contention.

  • If processes within a class vary greatly in their behaviors or resource consumption, create more classes to gain more granular control. Also, it might be desirable to create a separate class for each important application.

  • If your analysis shows the resource required by one class is dependent on the consumption of another class, reallocate your resources accordingly. For example, if the amount of resource required by ClassZ is dependent on the number of work requests that can be handled by ClassA, then ClassA must be guaranteed access to enough resources to provide what ClassZ needs.

  • If one or more applications are consistently not receiving enough resources to perform adequately, your only option might be to reduce the workload on the system.

Note: You can define an adminuser for a superclass to reduce the amount of work that is required of the WLM administrator. After the top-level configuration has been tested and tuned, subsequent changes (including creating and configuring subclasses) can be made by the superclass adminusers to suit their particular needs.