[AIX 운영 체제와 장치 관리 44] 워크로드 관리자(WLM) 개념 — 용어, 수퍼클래스와 서브클래스, 클래스 할당, 자원 제어와 한계, 가상 메모리 한계, 동작 모드, 동적 제어, 클래스별 계정

핵심 정리

  • WLM은 스케줄러, VMM, 디스크 I/O 하위 시스템이 프로세스에 자원을 나누는 방식을 관리자가 클래스 단위로 제어하게 합니다. 값을 극단적이거나 부정확하게 설정하면 성능이 크게 떨어집니다.
  • 클래스는 수퍼클래스와 서브클래스 2단계이며 수퍼클래스 69개(사용자 정의 64개), 수퍼클래스마다 서브클래스 64개(사용자 정의 61개)까지 둡니다. 프로세스는 exec 때 할당 규칙으로 자동 분류되고 setuid·setgid·setpri·plock 때 다시 평가됩니다.
  • CPU, 물리 메모리, 디스크 I/O 대역폭은 공유(share)와 최소·소프트 최대·하드 최대 비율로, 프로세스·스레드·로그인 수와 CPU 시간·디스크 I/O·접속 시간은 총량 한계로 제어합니다. 총량 한계를 넘은 프로세스는 끝납니다.
  • 가상 메모리 한계를 넘으면 vmenforce 속성(class 또는 proc, 기본은 proc)에 따라 클래스의 모든 프로세스나 원인 프로세스를 죽입니다.
  • 수동 모드는 규제 없이 분류와 사용량만 감시하고, CPU 전용 모드는 CPU만 규제합니다. 계정 레코드에는 클래스 이름 대신 64비트 키가 들어가므로 계정 기간 중 클래스를 지우면 Unknown으로 나옵니다.
항목 내용
버전 AIX 6.1 (장 도입이 새로 실림)
원문 Operating system and device management — 5.3판 183189쪽, 6.1판 468474쪽
관련 명령어 wlmcntrl, wlmstat, wlmmon, wlmperf, mkclass, chclass, rmclass, ps
관련 파일 /etc/wlm/current(현재 구성을 가리키는 심볼릭 링크), classes, rules

WLM(Workload Manager)은 스케줄러, VMM(가상 메모리 관리자), 디스크 I/O 하위 시스템이 프로세스에 자원을 할당하는 방식을 시스템 관리자가 더 잘 제어하도록 설계됐습니다.

WLM으로 서로 다른 작업 클래스가 서로 방해하지 않게 하고, 서로 다른 사용자 그룹의 요구에 따라 자원을 할당할 수 있습니다.

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

WLM은 주로 큰 시스템에서 쓰도록 만들었습니다. 큰 시스템은 흔히 서버 통합에 쓰입니다. 서버 통합에서는 여러 서버 시스템(프린터, 데이터베이스, 일반 사용자, 트랜잭션 처리 시스템 등)의 워크로드를 큰 시스템 하나로 합쳐 시스템 유지 비용을 줄입니다. 이런 워크로드는 서로 방해하는 일이 잦고 목표와 서비스 협약도 서로 다릅니다.

WLM은 시스템 동작이 아주 다른 사용자 집단 사이를 격리하기도 합니다. 그래서 어떤 동작의 워크로드(예: 대화형이나 CPU를 적게 쓰는 작업)가 다른 동작의 워크로드(예: 배치나 메모리를 많이 쓰는 작업) 때문에 사실상 굶는 일을 막을 수 있습니다.

또 WLM은 계정 하위 시스템과 연결돼, 사용자나 그룹별 표준 계정에 더해 WLM 클래스별로 자원 사용 계정을 할 수 있게 합니다.

관련 개념

  • 시스템 계정 — 시스템 계정 유틸리티로 여러 시스템 자원의 개인별, 그룹별 사용량을 모으고 보고할 수 있습니다.
영어 원문

Workload manager

Workload Manager (WLM) is designed to provide the system administrator with increased control over how the scheduler virtual memory manager (VMM) and the disk I/O subsystem allocate resources to processes.

You can use WLM to prevent different classes of jobs from interfering with each other and to allocate resources based on the requirements of different groups of users.

Attention: 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.

WLM is primarily intended for use with large systems. Large systems are often used for server consolidation, in which workloads from many different server systems (such as printer, database, general

user, and transaction processing systems) are combined into a single large system to reduce the cost of system maintenance. These workloads often interfere with each other and have different goals and service agreements.

WLM also provides isolation between user communities with very different system behaviors. This can prevent effective starvation of workloads with certain behaviors (for example, interactive or low CPU usage jobs) by workloads with other behaviors (for example, batch or high memory usage jobs).

Also, WLM ties into the accounting subsystem allowing users to do resource usage accounting per WLM class in addition to the standard accounting per user or group.

Related concepts

System accounting The system accounting utility allows you to collect and report on individual and group use of various system resources.

워크로드 관리 개념

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

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

관련 개념

  • 워크로드 관리자 관리 — WLM을 쓰면 시스템 관리자가 스케줄러와 VMM이 프로세스에 자원을 할당하는 방식을 더 잘 제어할 수 있습니다. 서로 다른 작업 클래스가 서로 방해하지 않게 하고 서로 다른 사용자 그룹의 요구에 따라 자원을 할당할 수 있습니다.

워크로드 관리 용어

워크로드 관리와 관련된 흔한 용어를 이 표에 나열하고 설명합니다.

용어 설명
클래스(class) 프로세스와 그 스레드의 모음입니다. 클래스에는 자원 한계 값과 목표 공유 집합이 하나 있습니다. class는 서브클래스와 수퍼클래스를 함께 가리키는 데 씁니다.
수퍼클래스(superclass) 서브클래스가 딸린 클래스입니다. 서브클래스에 속하지 않고 수퍼클래스에만 속하는 프로세스는 없습니다. 수퍼클래스에는 어떤 프로세스를 수퍼클래스에 할당할지 정하는 클래스 할당 규칙이 있습니다. 또 수퍼클래스에 속한 프로세스가 쓸 수 있는 자원량을 정하는 자원 한계 값과 자원 목표 공유가 있습니다. 이 자원은 서브클래스의 자원 한계 값과 자원 목표 공유에 따라 서브클래스에 나뉩니다.
서브클래스(subclass) 정확히 수퍼클래스 하나에 딸린 클래스입니다. 서브클래스의 모든 프로세스는 그 수퍼클래스의 구성원이기도 합니다. 서브클래스는 수퍼클래스가 쓸 수 있는 자원에만 접근합니다. 서브클래스에는 수퍼클래스에 할당된 프로세스 가운데 어느 것이 서브클래스에 속할지 정하는 클래스 할당 규칙이 있습니다. 또 서브클래스 프로세스가 쓸 수 있는 자원을 정하는 자원 한계 값과 자원 목표 공유가 있으며, 이는 수퍼클래스가 쓸 수 있는 자원(수퍼클래스의 목표) 가운데 얼마를 서브클래스 프로세스가 쓸 수 있는지 나타냅니다. WLM 관리는 Web-based System Manager, SMIT, WLM 명령행 인터페이스로 할 수 있습니다.
분류 방식(classification mechanism) 어떤 프로세스를 어느 클래스(수퍼클래스나 수퍼클래스 안 서브클래스)에 할당할지 정하는 클래스 할당 규칙 집합입니다.
클래스 할당 규칙(class assignment rule) 프로세스 속성 집합 안의 어떤 값이면 프로세스가 특정 클래스(수퍼클래스나 수퍼클래스 안 서브클래스)에 할당되는지 나타냅니다.
프로세스 속성 값(process attribute value) 프로세스 속성에 대해 프로세스가 가진 값입니다. 프로세스 속성에는 사용자 ID, 그룹 ID, 응용 프로그램 경로 이름 같은 속성이 있을 수 있습니다.
자원 한계 값(resource-limitation values) WLM이 자원 사용 값 집합에 대해 유지하는 값 집합입니다. 이 한계는 setrlimit 서브루틴으로 지정하는 자원 한계와 완전히 별개입니다.
자원 목표 공유(resource target share) 클래스(서브클래스나 수퍼클래스)가 쓸 수 있는 자원 몫입니다. 같은 수준과 등급의 다른 클래스 공유와 함께 써서 그 수준과 등급의 클래스 사이 원하는 자원 분배를 정합니다.
자원 사용 값(resource-utilization value) 프로세스나 프로세스 집합이 시스템에서 지금 쓰는 자원량입니다. 프로세스 하나인지 집합인지는 자원 수집 범위가 정합니다.
자원 수집 범위(scope-of-resource collection) 자원 사용량을 모으고 자원 한계 값을 적용하는 수준입니다. 클래스 안 각 프로세스 수준, 클래스 안 사용자별 모든 프로세스 합 수준, 클래스 안 모든 프로세스 합 수준이 있을 수 있습니다. 지금 지원하는 범위는 마지막 것뿐입니다.
프로세스 클래스 특성(process class properties) 프로세스가 할당된 클래스(서브클래스와 수퍼클래스)에 따라 프로세스에 주어지는 특성 집합입니다.
클래스 권한(class authorizations) 어느 사용자와 그룹이 클래스나 클래스 안 프로세스와 스레드에 작업할 수 있는지 나타내는 규칙 집합입니다. 프로세스를 클래스에 수동으로 할당하거나 수퍼클래스의 서브클래스를 만드는 권한도 포함합니다.
클래스 등급(class tier) 모든 클래스에 대한 자원 한계 우선순위 계층에서 클래스의 위치입니다. 한 등급 안 모든 클래스의 자원 한계(자원 목표 포함)를 채운 뒤에야 낮은 등급 클래스에 자원을 줍니다. 등급은 수퍼클래스와 서브클래스 수준 모두에 있습니다. 수퍼클래스에는 등급에 따라 자원을 주고, 수퍼클래스 안에서는 서브클래스에 수퍼클래스 안 등급 값에 따라 자원을 줍니다. 따라서 수퍼클래스 등급이 자원 분배의 주된 구분 요소이고, 서브클래스 등급은 수퍼클래스 안에서 더 작은 추가 구분 요소입니다.

워크로드 관리용 클래스

WLM에서 시스템 관리자는 클래스를 정의하고 클래스마다 속성 집합과 자원 한계를 정의할 수 있습니다.

프로세스는 시스템 관리자가 준 기준에 따라 클래스에 할당됩니다. 자원 권리와 한계는 클래스 수준에서 강제됩니다. 이렇게 서비스 클래스를 정의하고 응용 프로그램 클래스마다 자원 사용을 조절하면, 자원 사용 양상이 아주 다른 응용 프로그램이 서버 하나를 함께 쓸 때 서로 방해하지 않습니다.

WLM은 2단계 클래스 계층을 지원합니다.

  • 시스템 자원은 수퍼클래스마다의 자원 권리에 따라 수퍼클래스에 분배됩니다. 자원 권리는 시스템 관리자가 정의합니다.
  • 각 수퍼클래스는 다시 서브클래스를 가질 수 있습니다. 수퍼클래스에 할당된 자원은 서브클래스마다 준 자원 권리에 따라 서브클래스에 분배됩니다.
  • 시스템 관리자는 각 수퍼클래스의 서브클래스 관리를 수퍼클래스 관리자나 수퍼클래스 관리자 그룹에 위임할 수 있습니다.
  • WLM은 수퍼클래스를 69개(사용자 정의 64개)까지, 수퍼클래스마다 서브클래스를 64개(사용자 정의 61개)까지 지원합니다.
  • 조직의 필요에 따라 시스템 관리자는 수퍼클래스만 쓸지, 수퍼클래스와 서브클래스를 함께 쓸지 정할 수 있습니다.

참고: 이 WLM 설명 전체에서 클래스라는 용어는 수퍼클래스와 서브클래스 모두에 적용됩니다. 특정 클래스 형식에만 해당하면 그 형식을 명시합니다.

워크로드 관리를 위한 프로세스의 클래스 할당

프로세스는 시스템 관리자가 준 클래스 할당 규칙으로 클래스에 할당됩니다. 분류 기준은 사용자 ID, 그룹 ID, 응용 프로그램 파일 이름, 프로세스 형식, 응용 프로그램 태그 같은 프로세스 속성 집합의 값을 바탕으로 합니다.

정의된 규칙 집합으로 프로세스가 할당될 수퍼클래스를 정합니다. 이 수퍼클래스에 서브클래스가 정의돼 있으면 이 수퍼클래스용 규칙 집합이 또 있어 어느 프로세스에 어느 서브클래스를 할당할지 정합니다. 이 자동 할당 과정은 수퍼클래스와 서브클래스의 상속 속성도 고려합니다.

자동 클래스 할당은 프로세스가 exec 서브루틴을 부를 때 합니다. 프로세스가 분류에 쓰는 프로세스 속성을 바꿀 수 있는 서브루틴을 쓰면 클래스 할당을 다시 평가합니다. setuid, setgid, setpri, plock 서브루틴이 그 예입니다.

이 자동 클래스 할당과 함께, 알맞은 권한이 있는 사용자는 프로세스나 프로세스 그룹을 특정 수퍼클래스나 서브클래스에 수동으로 할당할 수 있습니다.

관련 개념

  • 클래스 속성 — WLM 클래스의 모든 속성을 나열합니다.

자원 제어

WLM은 자원을 두 가지 방식으로 관리합니다. 쓸 수 있는 자원의 비율로, 또는 전체 자원 사용량으로 관리합니다.

비율로 제어할 수 있는 자원은 다음과 같습니다.

  • 클래스 안 SCHED_OTHER 형식 스레드의 프로세서 사용. 클래스 안 모든 스레드가 쓴 프로세서 주기의 합입니다. 고정 우선순위 스레드는 조정할 수 없습니다. 그래서 바꿀 수 없고 프로세서 사용 목표를 넘을 수 있습니다.
  • 클래스 안 프로세스의 물리 메모리 사용. 클래스 안 프로세스에 속한 모든 메모리 페이지의 합입니다.
  • 클래스의 디스크 I/O 대역폭. 클래스가 접근하는 각 디스크 장치에서 클래스 안 스레드가 시작한 모든 I/O의 대역폭(초당 512바이트 블록 수)입니다.

총사용량으로 제어할 수 있는 자원은 클래스 총량과 프로세스 총량 두 범주 가운데 하나에 속합니다. 클래스 총량 범주에는 다음이 있습니다.

클래스 안 프로세스 수

클래스 안에서 한 번에 활성인 프로세스 수입니다.

클래스 안 스레드 수

클래스 안에서 한 번에 활성인 스레드 수입니다.

클래스 안 로그인 수

클래스 안에서 한 번에 활성인 로그인 세션 수입니다.

프로세스 총량 범주에는 다음이 있습니다.

총 CPU 시간

프로세스 하나가 누적한 CPU 시간 총량입니다.

총 디스크 I/O

프로세스 하나가 누적한 디스크 I/O 블록 총량입니다.

총 접속 시간

로그인 세션이 활성일 수 있는 시간 총량입니다.

자원 권리

WLM에서 시스템 관리자는 클래스별 자원 권리를 자원 형식마다 따로 지정할 수 있습니다.

이 권리는 다음을 나타내 지정합니다.

  • 여러 형식 자원의 사용 목표. 이 목표는 공유(share)로 지정합니다. 공유는 클래스 사이의 상대적 사용량으로 지정합니다. 예를 들어 두 클래스가 각각 CPU 공유 1과 3을 가지고 지금 활성인 클래스가 그 둘뿐이면, WLM이 CPU 조절에 쓰는 비율 목표는 각각 25%와 75%입니다. 목표 비율은 등급마다 그 등급의 활성 공유 수와 그 등급이 쓸 수 있는 자원량을 바탕으로 클래스별로 계산합니다.
  • 최소와 최대 한계. 이 한계는 쓸 수 있는 전체 자원의 비율로 지정합니다. WLM은 두 종류의 최대 한계를 지원합니다.
    • 소프트 최대 한계는 자원 경합이 있을 때 쓸 수 있게 할 자원의 최대량을 나타냅니다. 경합이 없으면, 곧 다른 누구도 그 자원이 필요 없으면 이 최대를 넘을 수 있습니다.
    • 하드 최대 한계는 자원 경합 여부와 상관없이 쓸 수 있게 할 자원의 최대량을 나타냅니다. 그러나 고정 우선순위 스레드는 이 규칙을 따르지 않아 한계를 넘을 수 있습니다.
  • 총량 한계. 총량 한계는 엄격히 강제됩니다. 프로세스가 총 소비 한계 가운데 하나를 넘으면 끝납니다. 클래스가 총량 한계 가운데 하나에 이르면 그 자원의 인스턴스를 또 만들게 될 작업은 모두 실패합니다.

대부분의 경우 소프트 최대 한계로 자원 권리를 충족하고 강제하기에 충분합니다. 하드 최대 한계는 자원 경합이 없을 때도 엄격히 강제되므로 시스템 자원이 쓰이지 않고 남을 수 있습니다. 하드 최대 한계는 너무 낮게 설정하면 시스템이나 응용 프로그램 성능에 큰 영향을 줄 수 있으므로 신중히 고려해 써야 합니다. 총량 한계도 프로세스가 끝나거나 의도대로 동작하지 않을 수 있으므로 조심해서 써야 합니다.

능동 모드에서 WLM은 활성 클래스를 목표 가까이 유지하려 합니다. 여러 한계 값에 제약이 거의 없으므로 모든 클래스에 걸친 어느 한계의 합이 100%를 훨씬 넘을 수 있습니다. 이 경우 모든 클래스가 활성이면 모든 클래스가 한계에 이를 수는 없습니다. WLM은 시스템 안 고정 우선순위가 아닌 스레드의 스케줄링 우선순위를 그 스레드가 속한 클래스가 한계와 목표에 비해 어떻게 하고 있는지에 따라 조정해 프로세서 소비를 조절합니다. 이 방식은 아주 짧은 간격(예: 10ms)의 프로세서 소비가 아니라 주어진 시간에 걸친 평균 프로세서 소비를 보장합니다.

예를 들어 클래스 A가 유일한 활성 클래스이고 프로세서 최소가 0%, 프로세서 목표가 공유 60이면 프로세서를 100% 얻습니다. 프로세서 최소 한계 0%, 프로세서 목표 공유 40인 클래스 B가 활성이 되면 클래스 A의 프로세서 사용률은 점차 60%로 줄고 클래스 B는 0%에서 40%로 늘어납니다. 시스템은 몇 초 안에 각각 60%와 40% 프로세서 사용률로 안정됩니다.

이 예는 클래스 사이에 메모리 경합이 없다고 가정합니다. 정상 작업 조건에서 프로세서와 메모리에 설정한 한계는 서로 의존합니다. 예를 들어 메모리 사용 최대 한계가 작업 집합에 비해 너무 낮으면 클래스가 목표는커녕 최소 프로세서 할당에도 이르지 못할 수 있습니다.

주어진 응용 프로그램 집합의 클래스 정의와 클래스 한계를 다듬는 데 도움이 되도록 WLM은 클래스별로 지금 쓰는 자원량을 보여 주는 보고 도구 wlmstat을 제공합니다. 시스템 감시용 그래픽 표시 도구 wlmmon도 제공합니다.

워크로드 관리자 가상 메모리 한계

WLM(Workload Manager) 가상 메모리 한계는 클래스나 프로세스에 가상 메모리 한계를 두어, 지나친 페이징으로 시스템 성능이 떨어지거나 시스템이 실패하는 것을 막는 수단을 관리자에게 줍니다.

한계를 넘으면 WLM은 다음 가운데 하나를 합니다.

  • 한계를 넘은 WLM 클래스 아래 모든 프로세스를 죽입니다.
  • WLM 클래스 사용량이 한계를 넘게 만든 프로세스만 죽입니다.
  • 프로세스 한계를 넘은 프로세스를 죽입니다.

가상 메모리 한계는 사용자 정의 클래스, 사용자 정의 수퍼클래스 아래 기본 서브클래스, 기본 수퍼클래스에 지정할 수 있습니다.

계정 목적으로 WLM은 클래스 전체나 프로세스의 사용량을 정할 때 다음만 가상 메모리로 봅니다.

  • 힙
  • 로더가 초기화한 데이터, BSS, 공유 라이브러리, 개별 로드 세그먼트
  • UBLOCK과 mmap 영역
  • 큰 사용자 공간 페이지와 고정(pinned) 사용자 공간 페이지

관리자는 클래스나 클래스 안 각 프로세스에 WLM 가상 메모리 한계를 지정할 수 있습니다. 클래스 한계를 넘으면 vmenforce 클래스 속성이 class인지 proc인지에 따라 WLM은 클래스에 할당된 모든 프로세스를 죽이거나, 한계를 넘게 만든 프로세스만 죽입니다. 기본 동작은 한계를 넘게 만든 프로세스만 죽이는 것입니다. 프로세스 한계는 프로세스의 가상 메모리 사용이 한계를 넘으면 그 프로세스를 죽입니다.

워크로드 관리자 동작 모드

WLM으로 자원 소비를 클래스별 비율, 클래스별 총량, 프로세스별 총량으로 조절할 수 있습니다. WLM을 능동 모드로 실행하면 모든 자원 형식의 조절을 켤 수 있습니다.

선택적으로 새 프로세스와 기존 프로세스를 분류하고 여러 클래스의 자원 사용을 감시하되 그 사용을 조절하지는 않는 WLM 모드를 시작할 수 있습니다. 이 모드를 수동 모드라 합니다.

수동 모드는 새 시스템에 WLM을 구성할 때 분류와 할당 규칙을 확인하고, WLM이 프로세서와 메모리 할당을 조절하지 않을 때 여러 클래스의 자원 사용 기준선을 잡는 데 쓸 수 있습니다. 그러면 시스템 관리자가 업무 목표를 이루려고 중요한 응용 프로그램을 우대하고 덜 중요한 작업을 제한하도록 자원 공유와 (필요하면) 자원 한계를 어떻게 적용할지 정하는 근거가 됩니다.

조절하고 싶은 자원이 프로세서 시간뿐이면 프로세서는 능동 모드로, 나머지 자원은 모두 수동 모드로 WLM을 실행할 수 있습니다. 이 모드를 CPU 전용 모드라 합니다. 클래스별 비율은 조절하고 싶지만 총량 자원 형식은 어느 것도 조절하고 싶지 않으면 클래스별 총량, 프로세스별 총량, 또는 둘 다에 대해 총량 자원 계정과 조절을 끌 수 있습니다. 모든 모드에서 자원 세트 바인딩을 끌 수 있습니다.

워크로드 관리자 동적 제어

WLM이 활성일 때 현재 구성의 어떤 매개변수든 언제든 바꿀 수 있습니다. 클래스 속성, 자원 공유와 한계, 할당 규칙을 바꾸고 새 클래스를 더하거나 기존 클래스를 지울 수 있습니다.

다음처럼 여러 방법으로 할 수 있습니다.

  • 지금 활성 구성의 속성 파일(심볼릭 링크 /etc/wlm/current가 가리키는 디렉터리)을 고치고 wlmcntrl 명령으로 WLM을 새로 고쳐 새 매개변수를 쓰게 합니다.
  • 매개변수 집합이 다른 구성을 하나 더 만들고 WLM을 갱신해 새 구성의 매개변수를 읽어 현재 구성으로 만듭니다.
  • WLM 명령행 인터페이스(mkclass, chclass, rmclass 명령)로 지금 활성 구성의 일부 매개변수를 고칩니다.
  • 응용 프로그램에서 WLM API로 지금 활성 구성의 일부 매개변수를 고칩니다.

구성 세트로 하루 중 지정한 시각에 새 구성으로 자동 전환할 수 있습니다. 구성 세트에서 관리자는 쓸 구성 집합과 각각이 활성일 시간 범위를 지정합니다.

모니터링 도구

다음 WLM 명령으로 WLM 통계를 표시하고 WLM 동작을 감시합니다.

  • wlmstat 명령은 텍스트 중심이며 통계를 텍스트(WLM이 관리하는 모든 자원 형식에 대한 클래스별 자원 사용 비율)로 표시합니다.
  • wlmmon 명령은 클래스별 자원 사용과 WLM 조절을 그래픽으로 보여 줍니다.
  • wlmperf 명령은 Performance Toolbox와 함께 제공되는 선택 도구로, 장기 기록과 재생 같은 기능을 더 제공합니다.

워크로드 관리자의 하위 호환성

wlmstat 명령의 기본 출력은 수퍼클래스만 나열하며 이전 버전과 비슷합니다.

예:

text
# wlmstat
               CLASS  CPU  MEM  DKIO
        Unclassified    0    0   0
           Unmanaged    0    0   0
             Default    0    0   0
              Shared    0    2   0
              System    2   12   0
              class1    0    0   0
              class2    0    0   0
#

WLM 관리자가 일부 수퍼클래스에 서브클래스를 정의했다면 서브클래스도 나열됩니다. 예:

text
# wlmstat
               CLASS  CPU  MEM  DKIO
        Unclassified    0    0   0
           Unmanaged    0    0   0
             Default    0    0   0
              Shared    0    2   0
              System    3   11   7
              class1   46    0   0
    class1.Default     28    0   0
     class1.Shared      0    0   0
        class1.sub1    18    0   0
              class2   48    0   0
#

ps 명령을 써도 출력은 같습니다. 서브클래스가 없는 수퍼클래스의 프로세스에 대해 ps 명령은 수퍼클래스 이름을 프로세스 클래스 이름으로 나열합니다.

클래스별 계정

AIX 계정 시스템 유틸리티로 여러 시스템 자원의 사용량을 사용자, 그룹, WLM 클래스별로 모으고 보고할 수 있습니다.

프로세스 계정을 켜면 운영 체제는 프로세스가 끝날 때 프로세스 자원 사용 통계를 계정 파일에 기록합니다. 이 계정 레코드에는 프로세스가 속했던 WLM 클래스 이름을 나타내는 64비트 숫자 키가 들어 있습니다.

계정 하위 시스템은 공간을 아끼려고 34자 클래스 이름 전체 대신 64비트 키를 씁니다(그렇지 않으면 계정 레코드 크기가 사실상 두 배가 됩니다). 프로세스별 데이터를 뽑으려고 계정 명령을 실행하면 앞서 말한 루틴으로 키를 클래스 이름으로 되돌립니다. 이 변환에는 지금 WLM 구성 파일에 있는 클래스 이름을 씁니다. 그래서 프로세스가 끝나 계정 레코드를 쓴 때와 계정 보고서를 실행하는 때 사이에 클래스가 지워졌다면 키에 맞는 클래스 이름을 찾을 수 없어 클래스가 Unknown으로 표시됩니다.

계정 기간 중 지운 클래스의 자원 사용 기록을 정확히 남기려면 다음 가운데 하나를 합니다.

  • 클래스를 지우는 대신 classes 파일에 클래스 이름을 남기고, 어떤 프로세스도 할당되지 않도록 rules 파일에서 클래스를 뺍니다. 그런 다음 계정 기간 끝에 계정 보고서를 만든 뒤 클래스를 지웁니다.
  • 또는 클래스가 속한 구성에서 클래스를 지우고, 그 기간의 계정 레코드를 만들 때까지 "더미" 구성(활성화하지 않는 구성)의 classes 파일에 클래스 이름을 남겨 둡니다.

관련 개념

  • 시스템 계정 — 시스템 계정 유틸리티로 여러 시스템 자원의 개인별, 그룹별 사용량을 모으고 보고할 수 있습니다.
영어 원문

Workload management concepts

With WLM, you can 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.

Related concepts

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.

Terminology for workload management

Common terms associated with workload management are listed and described in this table.

  • class — A class is a collection of processes and their associated threads. A class has a single set of resource-limitation values and target shares. class is used to describe both subclasses and superclasses.
  • superclass — A superclass is a class that has subclasses associated with it. No processes can belong to a superclass without also belonging to a subclass. A superclass has a set of class-assignment rules that determines which processes are assigned to the superclass. A superclass also has a set of resource-limitation values and resource target shares that determines the amount of resources that can be used by processes which belong to the superclass. These resources are divided among the subclasses based on the resources limitation values and resource target shares of the subclasses.
  • subclasses — A subclass is a class associated with exactly one superclass. Every process in a subclass is also a member of its superclass. Subclasses have access only to resources that are available to the superclass. A subclass has a set of class assignment rules that determines which of the processes assigned to the superclass belong to the subclass. A subclass also has a set of resource-limitation values and resource target shares that determines the resources that can be used by processes in the subclass. These resource-limitation values and resource target shares indicate how much of the resources available to the superclass (the target for the superclass) can be used by processes in the subclass. WLM administration can be done using either the Web-based System Manager, SMIT, or the WLM command-line interface.
  • classification mechanism — A classification mechanism is a set of class assignment rules that determines which processes are assigned to which classes (superclasses or subclasses within superclasses).
  • class assignment rule — A class assignment rule indicates which values within a set of process attributes result in a process being assigned to a particular class (superclass or subclass within a superclass).
  • process attribute value — A process attribute value is the value that a process has for a process attribute. The process attributes can include attributes such as user ID, group ID, and application path name.
  • resource-limitation values — Resource-limitation values are a set of values that WLM maintains for a set of resource utilization values. These limits are completely independent of the resource limits specified with the setrlimit subroutine.
  • resource target share — Resource target shares are the shares of a resource that are available to a class (subclass or superclass). These shares are used with other class shares (subclass or superclass) at the same level and tier to determine the desired distribution of the resources between classes at that level and tier.
  • resource-utilization value — A resource-utilization value is the amount of a resource that a process or set of processes is currently using in a system. Whether it is one process or a set of processes is determined by the scope of process resource collection.
  • scope-of-resource collection — The scope-of-resource collection is the level at which resource utilization is collected and the level at which resource-limitation values are applied. This might be at the level of each process in a class, the level of the sum across every process in a class owned by each user, or the level of the sum across every process in a class. The only scope currently supported is the latter.
  • process class properties — The process class properties are the set of properties that are given to a process based on the classes (subclass and superclass) to which it is assigned.
  • class authorizations — The class authorizations are a set of rules that indicates which users and groups are allowed to perform operations on a class or processes and threads in a class. This includes the authorization to manually assign processes to a class or to create subclasses of a superclass.
  • class tier — The class tier value is the position of the class within the hierarchy of resource limitation desirability for all classes. The resource limits (including the resource targets) for all classes in a tier are satisfied before any resource is provided to lower tier classes. Tiers are provided at both the superclass and subclass levels. Resources are provided to superclasses based on their tiers. Within a superclass, resources are given to subclasses based on their tier values within the superclass. Thus, superclass tier is the major differentiator in resource distribution; the subclass tier provides an additional smaller differentiator within a superclass.

Classes for workload management

WLM allows system administrators to define classes and define for each class a set of attributes and resource limits.

The processes are assigned to classes based on criteria provided by the system administrator. The resource entitlements and limits are enforced at the class level. This method of defining classes of service and regulating the resource utilization of each class of applications prevents applications with very different resource use patterns from interfering with each other when they share a single server.

WLM supports a hierarchy of classes with two levels:

  • The resources of the system are distributed among superclasses according to the resource entitlements for each superclass. The system administrator defines resource entitlements.

  • In turn, each superclass can have subclasses. The resources allocated to the superclass are distributed among the subclasses according to the resource entitlements given to each subclass.

  • The system administrator can delegate the administration of the subclasses of each superclass to a superclass administrator or to a group of superclass administrators.

  • WLM supports up to 69 superclasses (64 user-defined) and 64 subclasses per superclass (61 user-defined).

  • Depending on the needs of the organization, a system administrator can decide to use only superclasses or to use superclasses and subclasses.

Note: Throughout this discussion of WLM, the term class applies to both superclasses and subclasses. If discussion applies only to a specific class type, that type is explicitly mentioned.

Process assignment to classes for workload management

The processes are assigned to a class, using class-assignment rules provided by the system administrator. The classification criteria are based on the value of a set of attributes of the process such as user ID, group ID, name of the application file, type of process, and application tag.

A defined set of rules is used to determine the superclass a process is assigned to. If this superclass has subclasses defined, there is another set of rules for this superclass to determine which subclass is assigned to which process. This automatic assignment process also takes into account the inheritance attributes of both the superclass and the subclass.

The automatic class assignment is done when a process calls the exec subroutine. The class assignment is reevaluated when a process uses a subroutine that can alter a process attribute used for classification purposes. Examples are the setuid, setgid, setpri, and plock subroutines.

In addition to this automatic class assignment, a user with the proper authority can manually assign processes or groups of processes to a specific superclass or subclass.

Related concepts

Class attributes List all the attributes of a WLM class.

Resource control

WLM allows management of resources in two ways: as a percentage of available resources or as total resource usage.

Resources that can be controlled on a percentage basis include the following:

  • Processor use of the threads of type SCHED_OTHER in a class. This is the sum of all of the processor cycles consumed by every thread in the class. Fixed-priority threads are non-adjustable. Therefore, they cannot be altered, and they can exceed the processor usage target.

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

  • Disk I/O bandwidth of 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.

Resources that can be controlled on a total usage basis fall into one of two categories: class totals or process totals. The class totals category includes:

Number of processes in a class

This is the number of processes that are active in a class at one time.

Number of threads in a class

This is the number of threads that are active in a class at one time.

Number of logins in a class

This is the number of login sessions that are active in a class at one time.

The process totals category includes:

Total CPU time

This is the total accumulated CPU time for a single process.

Total disk I/O

This is the total accumulated blocks of disk I/O for a single process.

Total connect time

This is total amount of time that a login session can be active.

Resource entitlements:

WLM allows system administrators to specify per-class resource entitlements independently for each resource type.

These entitlements can be specified by indicating the following:

  • The target for usage of different types of resources. This target is specified with shares. The shares are specified as relative amounts of usage between different classes. For instance, if two classes have respectively 1 and 3 shares of CPU and are the only classes active at this time, their percentage goal used by WLM for its CPU regulation will be 25% and 75%, respectively. The target percentages are calculated for classes in each tier based on the number of active shares in the tier and the amount of resource available to the tier.

  • Minimum and maximum limits. These limits are specified as percentages of the total resource available. WLM supports two kinds of maximum limits: – A soft maximum limit indicates the maximum amount of the resource that can be made available when there is contention for the resource. This maximum can be exceeded if there is no contention; that is, if no one else requires the resource. – A hard maximum limit indicates the maximum amount of the resource that can be made available regardless of whether there is contention on the resource. Fixed-priority threads, however, are not subject to these same rules and therefore can exceed the limit.

  • Total limits. The total limits are strictly enforced. If a process exceeds one of its total consumption limits, it will be terminated. If a class is at one of its total limits, any operation that would result in the creation of another instance of that resource will fail.

In most cases, soft maximum limits are sufficient to ensure that resource entitlements are met and enforced. Using hard maximum limits may result in unused system resources since these are strictly enforced, even when there is no contention for the resource. Careful consideration must be made when using hard maximum limits since these can greatly affect system or application performance if set too low. Total limits should also be used with caution, since these could result in process termination or failure to function as intended.

In active mode, WLM attempts to keep active classes close to their targets. Since there are few constraints on the values of the various limits, the sum of any of the limits across all classes could far exceed 100%. In this case, if all of the classes are active, the limit cannot be reached by all classes. WLM regulates the processor consumption by adjusting the scheduling priorities of the non-fixed priority threads in the system according to how the class they belong to is performing, relative to its limits and target. This approach guarantees a processor consumption averaged over a given period of time, rather than the processor consumption over very short intervals (for example, 10 ms).

For example, if class A is the only active class, with a processor minimum of 0% and a processor target of 60 shares, then it gets 100% of the processor. If class B, with a processor minimum limit of 0% and a processor target of 40 shares, becomes active, then the class A processor utilization progressively decreases to 60% and the class B processor utilization increases from 0% to 40%. The system stabilizes at 60% and 40% processor utilization, respectively, in a matter of seconds.

This example supposes that there is no memory contention between the classes. Under regular working conditions, the limits you set for processor and memory are interdependent. For example, a class may be unable to reach its target or even its minimum processor allocation if the maximum limit on its memory usage is too low compared to its working set.

To help refine the class definition and class limits for a given set of applications, WLM provides the wlmstat reporting tool, which shows the amount of resource currently being used by each class. A graphical display tool, wlmmon, is also provided for system monitoring.

Workload Manager virtual memory limits

Workload Manager (WLM) virtual memory limits provide administrators a means to prevent system degradation or system failure due to excessive paging by providing a virtual memory limit on a class or a process.

When a limit is exceeded, WLM takes action by doing one of the following:

  • killing all processes under the WLM class that exceeded its limit

  • killing only the process that caused the WLM class usage to exceed its limit

  • killing the process that exceeded its process limit

Virtual memory limits can be specified for any user-defined class, any default subclass under a user-defined super class, and the default super class.

For accounting purposes, WLM will only consider the following as virtual memory when determining WLM total class or process usage:

  • heap

  • loader initialized data, BSS, shared library, and privately loaded segments

  • UBLOCK and mmap areas

  • large and pinned user space pages

An administrator can specify a WLM virtual memory limit for a class or for each process in the class. When a class limit is exceeded, WLM can either kill all processes assigned to the class, or only kill the process that caused the limit to be exceeded, depending on whether the vmenforce class attribute is set to class or proc, respectively. The default behavior is to only kill the process that caused the limit to be exceeded. A process limit is killed if the virtual memory use of the process surpasses the limit.

Modes of operation for Workload Manager

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.

The passive mode can be used when configuring WLM on a new system to verify the classification and assignment rules, and to establish a base line of resource utilization for the various classes when WLM does not regulate the processor and memory allocation. This should give a basis for system

administrators to decide how to apply the resource shares and resource limits (if needed) to favor critical applications and restrict less important work in order to meet their business goals.

If processor time is the only resource that you are interested in regulating, you can choose to run WLM in active mode for processor and passive mode for all other resources. This mode is called cpu only mode. If you want to regulate per-class percentages, but neither of the total resource types, the total resource accounting and regulation can be disabled for per-class totals, per-process totals, or both. In all modes, you have the option of disabling resource set binding.

Dynamic control of Workload Manager

When WLM is active, any parameter of the current configuration can be modified at any time, including the attributes of a class, its resource shares and limits, the assignment rules, and adding new classes or deleting existing classes.

This can be done in several ways, such as:

  • Modifying the property files for the currently active configuration (directory pointed to by the symbolic link /etc/wlm/current) and refreshing WLM by using the wlmcntrl command to use the new parameters.

  • Creating another configuration with a different set of parameters and updating WLM to load the parameters of the new configuration, thus making it the current configuration.

  • Modifying some of the parameters of the currently active configuration using the WLM command line interface (the mkclass, chclass, and rmclass commands).

  • Modifying some of the parameters of the currently active configuration from an application using the WLM APIs.

Automatic switches to a new configuration at specified times of day can be accomplished using configuration sets. Configuration sets allow the administrator to specify a set of configurations to be used, and a time range for which each will be active.

Monitoring tools:

Use these WLM commands to display WLM statistics and monitor the operation of WLM.

  • The wlmstat command is text oriented and displays statistics as text (percentage of resource utilization per class for all the resource types managed by WLM).

  • The wlmmon command gives a graphical view of per-class resource utilization and WLM regulation.

  • The wlmperf command is an optional tool available with the Performance Toolbox and provides more capabilities, such as long-term record and replay.

Backward compatibility in Workload Manager

The default output of the wlmstat command lists only the superclasses and is similar to those of previous versions.

For example:

text
# wlmstat
               CLASS  CPU  MEM  DKIO
        Unclassified    0    0   0
           Unmanaged    0    0   0
             Default    0    0   0
              Shared    0    2   0
              System    2   12   0
              class1    0    0   0
              class2    0    0   0
#

If some of the superclasses have subclasses defined by a WLM administrator, then the subclasses are listed. For example:

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

The output is the same when you use the ps command. For processes in a superclass without any subclasses, the ps command lists the superclass name as the process class name.

Per class accounting

The AIX accounting system utility lets you collect and report the use of various system resources by user, group, or WLM class.

When process accounting is turned on, the operating system records statistics about the process resource usage in an accounting file when the process exits. This accounting record includes a 64-bit numeric key representing the name of the WLM class that the process belonged to.

The accounting subsystem uses a 64-bit key instead of the full 34-character class name to save space (otherwise the change would practically double the size of the accounting record). When the accounting command is run to extract the per-process data, the key is translated back into a class name using the above-mentioned routine. This translation uses the class names currently in the WLM configuration files. So, if a class has been deleted between the time the accounting record was written, when the process terminated, and the time the accounting report is run, the class name corresponding to the key cannot be found, and the class displays as Unknown.

To keep accurate records of the resource usage of classes deleted during an accounting period, do one of the following:

  • Instead of deleting the class, keep the class name in the classes file and remove the class from the rules file so that no process can be assigned to it. Then you can delete the class after the accounting report has been generated at the end of the accounting period.

  • Or, delete the class from the configuration it belongs to, and keep the class name in the classes file in a "dummy" configuration (one that is never activated) until after the accounting records for the period have been generated.

Related concepts

System accounting The system accounting utility allows you to collect and report on individual and group use of various system resources.