schedo 명령어 (AIX 5.3·6.1)

핵심 정리

  • CPU 스케줄러(디스패처)의 조정 값을 보고 바꿉니다. root만 실행할 수 있습니다.
  • schedo -a(모든 값), schedo -o 이름(값 보기), schedo -o 이름=값(바꾸기), schedo -L [이름](현재·기본·부팅 값, 범위, 유형), schedo -h 이름(도움말).
  • -p는 현재 값과 다음 부팅 값(/etc/tunables/nextboot)을 함께, -r은 다음 부팅 값만 바꿉니다. -d 이름·-D는 기본값으로 되돌립니다.
  • 자주 보는 값: 우선순위 계산 sched_R·sched_D(기본 16), 타임 슬라이스 timeslice, 가상 프로세서 접기 vpm_xvcpus·vpm_fold_policy, 락 대기 maxspin, 메모리 부하 제어 v_repage_hi 등.
  • schedo가 다루는 값은 Dynamic과 Reboot 유형뿐입니다. 6.1에서 많은 값이 제한된 조정 값이 되어 -F를 줘야 목록에 보입니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 -F(제한된 조정 값 표시)와 WPAR 참고가 더해지고, 문서에 실린 조정 값이 크게 줄어 18개가 됨)
원문 IBM Commands Reference — 5.3 Volume 5, 6.1 Volume 5
파일 /usr/sbin/schedo, /etc/tunables/nextboot
관련 명령어 vmo, ioo, no, nfso, raso, ps al, bosboot

목적

CPU 스케줄러 조정 값을 관리합니다.

영어 원문

Manages processor scheduler tunable parameters.

구문

text
schedo [ -p | -r ] [ -y ] { -o Tunable [ = Newvalue ] }
schedo [ -p | -r ] [ -y ] { -d Tunable }
schedo [ -p | -r ] [ -y ] -D
schedo [ -p | -r ] [ -F ] -a
schedo -h [ Tunable ]
schedo [ -F ] -L [ Tunable ]
schedo [ -F ] -x [ Tunable ]

-o, -d, -x, -L은 여러 번 쓸 수 있습니다. -F는 6.1 구문에만 있습니다.

설명

참고: schedo는 root만 실행할 수 있습니다.

schedo 명령으로 스케줄러 조정 값을 설정합니다. 모든 스케줄러 조정 값의 현재 값이나 다음 부팅 값을 설정하거나 보여 주며, 바꾼 것을 영구로 하거나 다음 재부팅까지 미룰 수 있습니다. 설정할지 보여 줄지는 함께 주는 플래그가 정하며, -o는 둘 다 합니다.

조정 값을 바꾸는 영향

이 명령을 잘못 쓰면 성능이 떨어지거나 운영 체제가 실패할 수 있습니다. schedo로 시스템 값을 바꾸기 전에 Performance management의 해당 조정 절을 공부합니다.

조정 값을 바꾸기 전에 아래 조정 값 절에서 그 값의 특성을 모두 꼼꼼히 읽고, Refer To 안내를 따라가 목적을 완전히 이해합니다. 그다음 그 값의 Diagnosis와 Tuning 설명이 정말 지금 상황에 맞는지, 값을 바꾸면 성능이 나아질지 확인합니다. Diagnosis와 Tuning이 모두 "N/A"면, AIX 개발 부서가 따로 지시하지 않는 한 바꾸지 않습니다.

우선순위 계산 값

대부분의 사용자 프로세스 우선순위는 최근에 쓴 프로세서 시간에 따라 바뀝니다. 스케줄러의 우선순위 계산은 schedo로 정하는 sched_R과 sched_D 두 값에 바탕을 둡니다. 두 값의 단위는 32분의 1입니다. 최근 프로세서 사용에 대한 벌점으로 프로세스 우선순위 값에 더하는 양은 다음과 같습니다.

text
CPU penalty = (recently used CPU value of the process) * (r/32)

또 1초마다 각 프로세스의 최근 프로세서 사용 값을 다시 계산하는 식은 다음과 같습니다.

text
new recently used CPU value = (old recently used CPU value of the process) * (d/32)

r(sched_R)과 d(sched_D)의 기본값은 모두 16이며, 이전 운영 체제의 스케줄링 동작을 그대로 따릅니다. 이 값을 바꿔 보기 전에 Performance Management Guide의 "Tuning the processor scheduler"를 익힙니다.

메모리 부하 제어 값

스케줄러는 메모리가 지나치게 할당(overcommit)되면 프로세스를 멈춰(suspend) 메모리 부하를 제어합니다. 프로세스를 스왑 아웃하지는 않고, 지금 필요한 메모리를 채우려고 그때그때 페이지를 빼앗습니다. 보통 멈춘 프로세스에서 빼앗습니다. 다음 조건이면 메모리가 지나치게 할당된 것으로 봅니다.

  • p * h > s: p는 지난 1초 동안 페이징 공간에 쓴 페이지 수, h는 v_repage_hi 값, s는 지난 1초 동안 일어난 페이지 빼앗기 수입니다.

메모리가 지나치게 할당됐고 다음 조건이면 그 프로세스를 멈춥니다.

  • r * p > f: r은 그 프로세스가 지난 1초 동안 쌓은 재페이지(repage) 수, p는 v_repage_proc 값, f는 그 프로세스가 지난 1초 동안 겪은 페이지 폴트 수입니다.

고정 우선순위 프로세스와 커널 프로세스는 멈추지 않습니다. 재페이지는 회수됐다가 곧 그 프로세스가 다시 참조한 페이지의 수를 말합니다.

v_min_process로 최소 다중 프로그래밍 수준을 정해, 프로세스를 멈추는 동안에도 적어도 이만큼은 활성 상태로 남게 할 수 있습니다. 활성 프로세스는 실행할 수 있거나 페이지 I/O를 기다리는 프로세스입니다. 이벤트를 기다리는 프로세스, 멈춘 프로세스, wait 프로세스는 활성으로 치지 않습니다.

시스템이 v_sec_wait초 동안 지나친 할당 기준 아래에 머물면 멈춘 프로세스를 다시 들입니다. 먼저 우선순위, 그다음 멈춰 있던 시간 순으로 들입니다. 이 값을 바꿔 보기 전에 "VMM memory load control tuning with the schedo command"를 충분히 익힙니다.

타임 슬라이스 증가 값

디스패처가 다른 프로세스를 고르기 전에 한 프로세스를 실행하게 두는 시간(타임 슬라이스)도 바꿀 수 있습니다. 기본은 클록 틱 하나(10밀리초)입니다. timeslice 값은 타임 슬라이스 길이를 늘릴 클록 틱 수를 정합니다. AIX 버전 4부터 이 값은 SCHED_RR 스케줄링 정책 스레드에만 적용됩니다.

fork() 재시도 간격 값

페이징 공간이 모자라 fork() 호출이 실패하면 시스템은 정한 시간만큼 기다렸다가 다시 시도합니다. 이 간격을 pacefork 값으로 정합니다.

동시 다중 스레딩(SMT) 용어

실행 큐(run queue)는 여러 개이며, 프로세서마다 자기 실행 큐를 가집니다. POWER5 프로세서는 동시 다중 스레딩(SMT)을 지원해 물리 프로세서마다 하드웨어 스레드라는 실행 엔진이 둘 있고, 각각은 프로세서 하나와 거의 같습니다. SMT는 기본으로 켜져 있고 동적으로 끄거나 다시 켤 수 있습니다. SMT를 켜면 하드웨어 스레드마다 실행 큐를 하나씩 맡습니다. 예를 들어 4-way 시스템에서 SMT가 꺼져 있으면 전역 실행 큐 말고 실행 큐가 4개, 켜져 있으면 8개입니다.

같은 물리 프로세서에 속한 하드웨어 스레드를 형제(sibling) 스레드라 합니다. 첫 번째 하드웨어 스레드가 주(primary) 형제 스레드, 두 번째가 보조(secondary) 형제 스레드입니다.

가상 프로세서 관리

파티션의 일을 처리하는 데 필요한 것보다 가상 프로세서를 더 많이 정의할 수 있습니다. 가상 프로세서를 적게 쓰면 전체 프로세서 사용량이 줄거나 가상 프로세서가 모자라지 않으면서 디스패치 부담을 줄일 수 있습니다. 가상 프로세서는 파티션에서 동적으로 없어지지 않고, 쓰지 않다가 일이 더 생기면 다시 씁니다. 가상 프로세서 하나는 물리 프로세서를 최대 하나 씁니다. 필요한 가상 프로세서 수는 물리 프로세서 사용률과 vpm_xvcpus의 합을 올림해 정합니다.

text
number = ceiling( p_util + vpm_xvcpus)

number는 필요한 가상 프로세서 수, p_util은 물리 프로세서 사용률, vpm_xvcpus는 더 켤 가상 프로세서 수입니다. number가 지금 켜진 가상 프로세서 수보다 적으면 하나를 끄고, 많으면 꺼진 것 하나를 켭니다. 꺼진 가상 프로세서에 묶인(attach) 스레드는 그래도 그 프로세서에서 실행할 수 있습니다.

노드 부하

노드 부하(load)는 전역 실행 큐를 포함한 모든 실행 큐의 평균 깊이에 256을 곱한 값으로, 시간에 걸쳐 강하게 평활화됩니다. 예를 들어 프로세서(SMT 포함)가 16개인데 부하가 256이면, 지난 몇 밀리초 동안 실행할 수 있는 작업이 약 16개 있었다는 뜻입니다.

영어 원문

Note: The schedo command can only be executed by root.

Use the schedo command to configure scheduler tuning parameters. This command sets or displays current or next boot values for all scheduler tuning parameters. This command can also make permanent changes or defer changes until the next reboot. Whether the command sets or displays a parameter is determined by the accompanying flag. The -o flag performs both actions. It can either display the value of a parameter or set a new value for a parameter.

Understanding the Effect of Changing Tunable Parameters

Misuse of this command can cause performance degradation or operating-system failure. Be sure that you have studied the appropriate tuning sections in the Performance management before using schedo to change system parameters.

Before modifying any tunable parameter, you must first carefully read about all its characteristics in the Tunable Parameters section below, and follow any Refer To pointer, in order to fully understand its purpose.

You must then make sure that the Diagnosis and Tuning sections for this parameter truly apply to your situation and that changing the value of this parameter could help improve the performance of your system.

If the Diagnosis and Tuning sections both contain only "N/A", you must never change this parameter unless specifically directed by AIX development.

Priority-Calculation Parameters

The priority of most user processes varies with the amount of processor time the process has used recently. The processor scheduler's priority calculations are based on two parameters that are set with schedo, sched_R and sched_D. The sched_R and sched_D values are in thirty-seconds (1/32); that is, the formula used by the scheduler to calculate the amount to be added to a process's priority value as a penalty for recent processor use is: CPU penalty = (recently used CPU value of the process) * (r/32)

and the once-per-second recalculation of the recently used processor value of each process is: new recently used CPU value = (old recently used CPU value of the process) * (d/32)

Both r (sched_R parameter) and d (sched_D parameter) have default values of 16. This maintains the processor scheduling behavior of previous versions of the operating system. Before experimenting with these values, you must be familiar with "Tuning the processor scheduler" in the Performance Management Guide.

Memory-Load-Control Parameters

The operating system scheduler performs memory load control by suspending processes when memory is over committed. The system does not swap out processes; instead pages are stolen as they are needed to fulfill the current memory requirements. Typically, pages are stolen from suspended processes. Memory is considered over committed when the following condition is met:

  • p * h s — where: p is the number of pages written to paging space in the last second h is an integer specified by the v_repage_hi parameter s is the number of page steals that have occurred in the last second

A process is suspended when memory is over committed and the following condition is met:

  • r * p f — where: r r is the number of repages that the process has accumulated in the last second p is an integer specified by the v_repage_proc parameter f is the number of page faults that the process has experienced in the last second

In addition, fixed-priority processes and kernel processes are exempt from being suspended.

The term repages refers to the number of pages belonging to the process, which were reclaimed and are soon after referenced again by the process.

The user also can specify a minimum multiprogramming level with the v_min_process parameter. Doing so ensures that a minimum number of processes remain active throughout the process-suspension period. Active processes are those that are runnable and waiting for page I/O. Processes that are waiting for events and processes that are suspended are not considered active, nor is the wait process considered active.

Suspended processes can be added back into the mix when the system has stayed below the over committed threshold for n seconds, where n is specified by the v_sec_wait parameter. Processes are added back into the system based, first, on their priority and, second, on the length of their suspension period.

Before experimenting with these values, you must be thoroughly familiar with "VMM memory load control tuning with the schedo command" in the Performance Management Guide.

Time-Slice-Increment Parameter

The schedo command can also be used to change the amount of time the operating system allows a given process to run before the dispatcher is called to choose another process to run (the time slice). The default value for this interval is a single clock tick (10 milliseconds). The timeslice tuning parameter allows the user to specify the number of clock ticks by which the time slice length is to be increased.

In AIX Version 4, this parameter only applies to threads with the SCHED_RR scheduling policy. See Scheduling Policy for Threads.

fork() Retry Interval Parameter

If a fork() subroutine call fails because there is not enough paging space available to create a new process, the system retries the call after waiting for a specified period of time. That interval is set with the pacefork tuning parameter.

Special Terminology for Symmetric Multithreading

Multiple run queues are supported. Under this scheme each processor has it's own run queue. POWER5 processors support symmetric multithreading, where each physical processor has two execution engines, called hardware threads. Each hardware thread is essentially equivalent to a single processor. Symmetric multithreading is enabled by default, but it can be disabled (or re-enabled) dynamically. When symmetric multithreading is enabled, each hardware thread services a separate run queue. For example, on a 4-way system when symmetric multithreading is disabled or not present, there are 4 run queues in addition to the global run queue. When symmetric multithreading is enabled, there are 8 run queues in addition to the global run queue.

The hardware threads belonging to the same physical processor are referred to as sibling threads. A primary sibling thread is the first hardware thread of the physical processor. A secondary sibling thread is the second hardware thread of the physical processor.

Virtual Processor Management

More virtual processors can be defined than are needed to handle the work in a partition. The overhead of dispatching virtual processors can be reduced by using fewer virtual processors without a decrease in overall processor usage or a lack of virtual processors. Virtual processors are not dynamically removed from the partition, but instead are not used and are used again only when additional work is available. Each virtual processor uses a maximum of one physical processor. The number of virtual processes needed is determined by rounding up the sum of the physical processor utilization and the vpm_xvcpus tunable: number = ceiling( p_util + vpm_xvcpus)

Where number is the number of virtual processors that are needed, p_util is the physical processor utilization, and vpm_xvcpus is a tunable that specifies the number of additional virtual processors to enable. If number is less than the number of currently enabled virtual processors, a virtual processor will be disabled. If number is greater than the number of currently enabled virtual processors, a disabled virtual processor will be enabled. Threads that are attached to a disabled virtual processor are still allowed to run on the disabled virtual processor.

Node Load

The node load, or simply load, is the average run queue depth across all run queues, including the global run queue multiplied by 256, and is strongly smoothed over time. For example, a load of 256 means that if we have 16 processors (including symmetric multithreading processors), then we have had approximately 16 runnable jobs in the system for the last few milliseconds.

플래그

플래그 설명
-a 모든 조정 값의 현재 값(-r이면 재부팅 값, -p면 영구 값)을 한 줄에 tunable = value 하나씩 보여 줍니다. 영구 값은 재부팅 값과 현재 값이 같을 때만 보이고, 아니면 NONE입니다.
-d Tunable 조정 값을 기본값으로 되돌립니다. 기본값이 아니어서 바꿔야 하는데 Bosboot·Reboot 유형이거나, Incremental 유형이 기본값에서 바뀌었고 -r을 함께 쓰지 않았으면, 경고만 내고 바꾸지 않습니다.
-D 모든 조정 값을 기본값으로 되돌립니다. 제약은 -d와 같습니다.
-F -a, -L, -x만 줘서 모든 조정 값을 나열할 때 제한된(restricted) 조정 값도 보여 줍니다. -F가 없으면 이름을 직접 지정하지 않는 한 보이지 않습니다. 6.1부터
-h [Tunable] 조정 값의 도움말을 보여 줍니다. 이름이 없으면 사용법을 보여 줍니다.
-L [Tunable] 조정 값 하나나 전부의 특성(현재·기본·재부팅 값, 최소·최대, 단위, 유형, 의존 관계)을 한 줄에 하나씩 보여 줍니다.
-o Tunable[=Newvalue] 값을 보여 주거나 Newvalue로 바꿉니다. 바꿔야 하는데 Bosboot·Reboot 유형이거나, Incremental 유형이고 현재 값이 새 값보다 크며 -r이 없으면 바꾸지 않고 경고합니다. -r과 함께 새 값 없이 쓰면 다음 부팅 값을, -p와 함께 새 값 없이 쓰면 현재 값과 다음 부팅 값이 같을 때만 값을(아니면 NONE) 보여 줍니다.
-p -o, -d, -D와 함께 쓰면 현재 값과 재부팅 값을 함께 바꿉니다. 곧 현재 값과 함께 /etc/tunables/nextboot도 고칩니다. 현재 값을 바꿀 수 없는 Reboot·Bosboot 유형에는 쓸 수 없습니다. -a나 새 값 없는 -o와 함께 쓰면 현재 값과 다음 부팅 값이 같을 때만 값을 보여 줍니다.
-r -o, -d, -D와 함께 쓰면 재부팅 값을 바꿉니다(/etc/tunables/nextboot를 고침). Bosboot 유형을 바꾸면 bosboot를 실행하라고 묻습니다. -a나 새 값 없는 -o와 함께 쓰면 현재 값 대신 다음 부팅 값을 보여 줍니다.
-x [Tunable] 조정 값 하나나 전부의 특성을 스프레드시트 형식(tunable,current,default,reboot,min,max,unit,type,{dtunable})으로 한 줄에 하나씩 보여 줍니다.
-y bosboot를 실행하기 전의 확인 질문을 하지 않습니다.

유형(TYPE): D 동적(Dynamic), S 정적(Static), R 재부팅(Reboot), B bosboot(Bosboot), M 마운트(Mount), I 증가만(Incremental), C 연결(Connect), d 폐기 예정(Deprecated).

  • 제한된 조정 값을 바꾸면 경고를 보여 주고, -r이나 -p를 주면 확인을 받습니다. -r·-p로 기본값과 다르게 바꿔 /etc/tunables/nextboot에 남은 제한된 조정 값은 재부팅할 때 오류 로그 항목을 남깁니다(6.1).
  • 값에는 K(2의 10제곱), M(20제곱), G(30제곱), T(40제곱), P(50제곱), E(60제곱) 같은 단위 약어를 쓸 수 있습니다. 예를 들어 1024는 1K입니다.
  • Mount 유형을 -o, -d, -D로 바꾸면 이후에 마운트하는 것에만 적용된다는 경고가 나옵니다.

참고(6.1): -o, -d, -D는 스케줄러 조정 값을 바꾸려 하므로 WPAR 안에서 지원하지 않습니다.

  • Connect 유형을 바꾸면 inetd를 다시 시작하고 그 사실을 알립니다.
  • Bosboot·Reboot 유형을 -r 없이 바꾸려 하면 오류가 납니다.
  • Incremental 유형의 현재 값을 더 작은 값으로 바꾸려 하면(-r 없이) 오류가 납니다.
영어 원문
  • -a — Displays the current, reboot (when used in conjunction with -r) or permanent (when used in conjunction with -p) value for all tunable parameters, one per line in pairs Tunable = Value. For the permanent option, a value is only displayed for a parameter if its reboot and current values are equal. Otherwise NONE displays as the value.
  • -d Tunable — ResetsTunable to its default value. If a tunable needs to be changed (that is, it is currently not set to its default value, and -r is not used in combination, it won't be changed but a warning is displayed.
  • -D — Resets all tunables to their default value. If tunables needing to be changed are of type Bosboot or Reboot, or are of type Incremental and have been changed from their default value, and -r is not used in combination, they will not be changed but a warning displays.
  • -F — Forces the display of restricted tunable parameters when you specify the -a, -L or -x options on the command line, to list all of the tunables. If you do not specify the -F flag, restricted tunables are not included, unless they are specifically named in association with a display option.
  • -h [Tunable] — Displays help about the Tunable parameter if one is specified. Otherwise, displays the schedo command usage statement.
  • -L [ Tunable ] — Lists the characteristics of one or all tunables, one per line, using the following format: NAME CUR DEF BOOT MIN MAX UNIT TYPE DEPENDENCIES -------------------------------------------------------------------------------- v_repage_hi 0 0 0 0 2047M D -------------------------------------------------------------------------------- v_repage_proc 4 4 4 0 2047M D -------------------------------------------------------------------------------- v_sec_wait 1 1 1 0 2047M seconds D -------------------------------------------------------------------------------- ... where: CUR = current value DEF = default value BOOT = reboot value MIN = minimal value MAX = maximum value UNIT = tunable unit of measure TYPE = parameter type: D (for Dynamic), S (for Static), R (for Reboot), B (for Bosboot), M (for Mount), I (for Incremental), C (for Connect), and d (for Deprecated) DEPENDENCIES = list of dependent tunable parameters, one per line
  • -o Tunable [=Newvalue] — Displays the value or sets Tunable to Newvalue. If a tunable needs to be changed (the specified value is different than current value), and is of type Bosboot or Reboot, or if it is of type Incremental and its current value is bigger than the specified value, and -r is not used in combination, it will not be changed but a warning displays. When -r is used in combination without a new value, the nextboot value for tunable is displayed. When -p is used in combination without a new value, a value displays only if the current and next boot values for tunable are the same. Otherwise NONE displays as the value.
  • -p — Makes changes apply to both current and reboot values, when used in combination with -o, -d or -D, that is, turns on the updating of the /etc/tunables/nextboot file in addition to the updating of the current value. These combinations cannot be used on Reboot and Bosboot type parameters because their current value can't be changed. When used with -a or -o without specifying a new value, values are displayed only if the current and next boot values for a parameter are the same. Otherwise NONE displays as the value.
  • -r — Makes changes apply to reboot values when used in combination with -o, -d or -D, that is, turns on the updating of the /etc/tunables/nextboot file. If any parameter of type Bosboot is changed, the user will be prompted to run bosboot. When used with -a or -o without specifying a new value, next boot values for tunables display instead of current values.
  • -x [Tunable] — Lists characteristics of one or all tunables, one per line, using the following (spreadsheet) format: tunable,current,default,reboot,min,max,unit,type,{dtunable } where: current = current value default = default value reboot = reboot value min = minimal value max = maximum value unit = tunable unit of measure type = parameter type: D (for Dynamic), S (for Static), R (for Reboot), B (for Bosboot),M (for Mount), I (for Incremental), C (for Connect), and d (for Deprecated) dtunable = space separated list of dependent tunable parameters
  • -y — Suppresses the confirmation prompt before executing the bosboot command.
  • Note: Options -o, -d, and -D are not supported within a workload partition because they attempt to

change the value of a scheduler tunable parameter.

If you make any change (with the -o, -d, or -D options) to a restricted tunable parameter, it results in a warning message that a tunable parameter of the restricted-use type, has been modified. If you also specified the -r or -p options on the command line, you will be prompted to confirm the change. In addition, at system reboot, restricted tunables that are displayed in the /etc/tunables/nextboot file, which were modified to values that are different from their default values (using a command line specifying the -r or -p options), causes an error log entry that identifies the list of these modified tunables.

When modifying a tunable, you can specify the tunable value using the abbreviations such as K, M, G, T, P and E to indicate units. See units. The following table shows the prefixes and values that are associated with the number abbreviations:

Abbreviation Power of 2 K 1024 M 1 048 576 G 1 073 741 824 T 1 099 511 627 776 P 1 125 899 906 842 624 E 1 152 921 504 606 846 976

Thus, a tunable value of 1024 might be specified as 1K.

Any change (with -o, -d or -D) to a parameter of type Mount results in a message displaying to warn you that the change is only effective for future mountings.

Any change (with -o, -d or -D flags) to a parameter of type Connect will result in inetd being restarted, and in a message being displayed to warn the user that the change is only effective for future socket connections.

Any attempt to change (with -o, -d or -D) a parameter of type Bosboot or Reboot without -r, results in an error message.

Any attempt to change (with-o, -d or -D but without -r) the current value of a parameter of type Incremental with a new value smaller than the current value, results in an error message.

조정 값 유형

튜닝 명령(no, nfso, vmo, ioo, raso, schedo)이 다루는 모든 조정 값은 다음 유형으로 나뉩니다.

유형 뜻
Dynamic 언제든 바꿀 수 있음
Static 바꿀 수 없음
Reboot 재부팅 때만 바꿀 수 있음
Bosboot bosboot를 실행하고 재부팅해야 바뀜
Mount 앞으로 마운트하는 파일 시스템·디렉터리에만 적용
Incremental 부팅 때가 아니면 늘리기만 할 수 있음
Connect 앞으로 맺는 소켓 연결에만 적용
Deprecated 지금 AIX 릴리스에서는 바꾸는 것을 더는 지원하지 않음

Bosboot 유형을 바꾸면 튜닝 명령이 bosboot를 실행할지 묻습니다. Connect 유형을 바꾸면 inetd 데몬을 자동으로 다시 시작합니다. schedo가 다루는 값은 Dynamic과 Reboot 유형뿐입니다.

영어 원문

All the tunable parameters manipulated by the tuning commands (no, nfso, vmo, ioo, raso, and schedo) have been classified into these categories:

  • Dynamic — If the parameter can be changed at any time
  • Static — If the parameter can never be changed
  • Reboot — If the parameter can only be changed during reboot
  • Bosboot — If the parameter can only be changed by running bosboot and rebooting the machine
  • Mount — If changes to the parameter are only effective for future file systems or directory mounts
  • Incremental — If the parameter can only be incremented, except at boot time
  • Connect — If changes to the parameter are only effective for future socket connections
  • Deprecated — If changing this parameter is no longer supported by the current release of AIX.

For parameters of type Bosboot, whenever a change is performed, the tuning commands automatically prompt the user to ask if they want to execute the bosboot command. For parameters of type Connect, the tuning commands automatically restart the inetd daemon.

Note that the current set of parameters managed by the schedo command only includes Dynamic, and Reboot types.

호환 모드

5.2 이전 호환 모드(sys0의 pre520tune 속성으로 제어)에서는 Bosboot 유형을 뺀 값의 재부팅 값이 별 의미가 없습니다. 이 모드에서는 부팅 때 적용되지 않기 때문입니다.

이 모드에서는 예전처럼 부팅 과정에서 부르는 스크립트에 튜닝 명령을 넣어 재부팅 값을 정합니다. 그래서 기존 스크립트가 계속 동작하도록 Reboot 유형을 -r 없이 설정할 수 있습니다.

AIX 5.2로 마이그레이션한 시스템에서는 이 모드가 자동으로 켜집니다. 새로 설치하면 꺼지고, 재부팅 때 /etc/tunables/nextboot 내용을 적용해 재부팅 값을 정합니다. 이 모드가 꺼져 있을 때만 -r과 -p가 제대로 동작합니다.

영어 원문

When running in pre 5.2 compatibility mode (controlled by the pre520tune attribute of sys0, see AIX 5.2 compatibility mode in the Performance management), reboot values for parameters, except those of type Bosboot, are not really meaningful because in this mode they are not applied at boot time.

In pre 5.2 compatibility mode, setting reboot values to tuning parameters continues to be achieved by imbedding calls to tuning commands in scripts called during the boot sequence. Parameters of type Reboot can therefore be set without the -r flag, so that existing scripts continue to work.

This mode is automatically turned ON when a machine is MIGRATED to AIX 5.2. For complete installations, it is turned OFF and the reboot values for parameters are set by applying the content of the /etc/tunables/nextboot file during the reboot sequence. Only in that mode are the -r and -p flags fully functional. See Kernel Tuning in the Performance Tools Guide and Reference for more information.

조정 값

각 조정 값의 기본값과 범위는 schedo -h 이름으로 봅니다. 아래는 6.1 문서에 실린 조정 값과 그 쓰임입니다.

조정 값 목적 조정 참고
affinity_lim SCHED_FIFO2 정책이 스레드를 더는 우대하지 않게 되는, 사이에 끼는 디스패치 수 효과는 작업에 따라 다르며 시행착오로 정함
big_tick_size 물리 틱 간격을 정하고 CPU 사이 틱을 맞춤 이 값 곱하기 10ms가 틱 간격이고 100을 나누어떨어지게 해야 함. 시스템 통계가 덜 정확해짐
ded_cpu_donate_thresh 전용 프로세서를 기증(donate)할 사용률 기준 기증을 켠 전용 프로세서 파티션에서 사용률이 이 기준보다 낮으면 쉬는 동안 공유 풀에 빌려줌
fixed_pri_global 고정 우선순위 스레드를 전역 실행 큐에 둘지 1이면 전역 실행 큐에 둠
force_grq MPI가 아닌 스레드를 전역 실행 큐에 둘지 1이면 MPI 스레드와 묶인 스레드만 로컬 실행 큐를 씀
maxspin 커널 락에서 잠들기 전에 돌며(spin) 기다리는 횟수 MP 시스템에서 올리면 유휴 시간이 줄 수 있지만 CPU를 낭비할 수 있음. 단일 프로세서에서는 올리지 않음
pacefork 페이징 공간이 모자라 실패한 fork를 다시 시도하기 전에 기다릴 클록 틱 수 페이징 공간이 모자라 fork가 안 될 때. 실패한 fork는 다섯 번 다시 시도
proc_disk_stats 프로세스 범위 디스크 통계를 켤지(1)·끌지(0). 기본 1 통계가 필요 없으면 꺼서 성능을 높임
sched_D 단기 CPU 사용량의 감쇠율 기본은 1초마다 1/2(16/32)로 줄임. 낮추면 포그라운드 프로세스가 백그라운드 프로세스와 더 오래 경쟁하지 않음
sched_R 우선순위 계산에서 단기 CPU 사용량의 가중치 ps al에서 NI 20인 포그라운드 프로세스의 PRI가 NI가 더 큰 백그라운드보다 높으면 낮춤. 기본 1/2(16/32)
tb_balance_S0 SMT 코어 바쁨 균형 조정 0 끔, 1 MCM(S2 그룹) 안에서만, 2 완전히 켬
tb_balance_S1 프로세서 바쁨 균형 조정 0 끔, 1 MCM 안에서만, 2 완전히 켬
tb_threshold thread_busy 부하 균형에서 스레드를 바쁘다고 볼 틱 수 100은 1초, 10은 0.1초, 1000은 10초
timeslice 스레드가 실행 큐로 돌아가기 전에 실행할 수 있는 클록 틱 수 올리면 디스패치 부담이 줄어듦. 고정 우선순위 프로세스에만 영향
vpm_fold_policy 파티션에서 프로세서 접기(folding) 기능을 적용하는 방식 비트 0(0x1) 공유 프로세서일 때 켬, 비트 1(0x2) 전용 프로세서일 때 켬, 비트 2(0x4) 정적 절전 모드에서 자동으로 켜지는 것을 막음. 비트를 OR로 합침
vpm_throughput_core_threshold vpm_throughput_mode를 따르기 전에 펼쳐져야 할 코어 수 그 전까지는 vpm_throughput_mode가 1인 것처럼 동작
vpm_throughput_mode 확장 처리량(scaled throughput) 모드의 SMT 활용 수준 0은 기본 동작(원시 처리량 모드), 1·2·4는 확장 처리량 모드와 SMT 활용 수준
vpm_xvcpus -1보다 크면 CPU 사용률에 따라 가상 프로세서를 켜고 끔 작업에 필요한 것 말고 더 켤 가상 프로세서 수

5.3 문서에는 이 밖에 v_repage_hi, v_repage_proc, v_min_process, v_sec_wait, v_exempt_secs, idle_migration_barrier, krlock_*, smt_snooze_delay, hotlocks_enable, unboost_inflih, *_mload 같은 실행 큐 탐색 값 등 더 많은 조정 값이 실려 있습니다. 6.1에서는 이들 중 다수가 제한된 조정 값이 되어 schedo -F -L로 봅니다. 반대로 ded_cpu_donate_thresh, proc_disk_stats, vpm_fold_policy, vpm_throughput_*는 6.1 문서에만 있습니다.

영어 원문

For default values and range of values for tunables, refer schedo command help (-h <tunable_parameter_name>).

  • affinity_lim — Purpose: Sets the number of intervening dispatches after which the SCHED_FIFO2 policy no longer favors a thread. Tuning: Once a thread is running with SCHED_FIFO2 policy, tuning of this variable may or may not have an effect on the performance of the thread and workload. Ideal values must be determined by trial and error.
  • big_tick_size — Purpose: Sets physical tick interval and synchronizes ticks across cpus. Tuning: The big_tick_size value times 10 ms as a tick interval, and must evenly divide into 100. Use of this parameter will make system statistics less accurate.
  • ded_cpu_donate_thresh — Purpose: Specifies the utilization threshold for donation of a dedicated processor. Tuning: In a dedicated processor partition that is enabled for donation, idle processor capacity can be donated to the shared processor pool for use by shared processor partitions. If a dedicated processor's utilization is less than this threshold, the dedicated processor will be donated for use by other partitions when the processor is idle. If a dedicated processor's utilization is equal to or greater than this threshold, the dedicated processor will not be donated for use by other partitions when the dedicated processor is idle.
  • fixed_pri_global — Purpose: Keep fixed priority threads on global run queue. Tuning: If 1, then fixed priority threads are placed on the global run queue.
  • force_grq — Purpose: Keep non-MPI threads on the global run queue. Tuning: If 1, only MPI and bound threads will use local run queues.
  • maxspin — Purpose: Sets the number of times to spin on a kernel lock before going to sleep. Tuning: Increasing the value on MP systems may reduce idle time; however, it might also waste CPU time in some situations. Increasing it on uniprocessor systems is not recommended.
  • pacefork — Purpose: The number of clock ticks to wait before retrying a failed fork call that has failed for lack of paging space. Tuning: Use when the system is running out of paging space and a process cannot be forked. The system will retry a failed fork five times. For example, if a fork() subroutine call fails because there is not enough paging space available to create a new process, the system retries the call after waiting the specified number of clock ticks.
  • proc_disk_stats — Purpose: A value of 1 enables and a value of 0 disables the process scope disk statistics. The default value is 1 and ranges from 0 to 1. Tuning: Disabling process scope disk statistics improves performance when the statistics are not wanted.
  • sched_D — Purpose: Sets the short term CPU usage decay rate. Tuning: The default is to decay short-term CPU usage by 1/2 (16/32) every second. Decreasing this value enables foreground processes to avoid competition with background processes for a longer time.
  • sched_R — Purpose: Sets the weighting factor for short-term CPU usage in priority calculations. Tuning: Run the command ps al. If you find that the PRI column has priority values for the foreground processes (those with NI values of 20) that are higher than the PRI values of some background processes (NI values > 20), you can reduce the r value. The default is to include 1/2 (16/32) of the short term CPU usage in the priority calculation. Decreasing this value makes it easier for foreground processes to compete.
  • tb_balance_S0 — Purpose: Controls SMT-cores busy balancing. Tuning: A value of 0 indicates that the balancing is disabled. A value of 1 indicates that the balancing is enabled only within MCMs (S2 groups). A value of 2 indicates fully enabled.
  • tb_balance_S1 — Purpose: Controls processor busy balancing. Tuning: A value of 0 indicates that the balancing is disabled. A value of 1 indicates that the balancing is enabled only within MCMs (S2 groups). A value of 2 indicates fully enabled.
  • tb_threshold — Purpose: Number of ticks to consider a thread busy for the purposes of optimization for thread_busy load balancing. Tuning: A value of 100 corresponds to 1 second. The values 10 and 1000 correspond to 0.1 and 10 seconds, respectively.
  • timeslice — Purpose: The number of clock ticks a thread can run before it is put back on the run queue. Tuning: Increasing the timeslice value can reduce overhead of dispatching threads. The value refers to the total number of clock ticks in a timeslice and only affects fixed-priority processes.
  • vpm_fold_policy — Purpose: Controls the application of the virtual processor management feature of processor folding in a partition. Tuning: The virtual processor management feature of processor folding can be enabled or disabled based on whether a partition has shared or dedicated processors. In addition, when the partition is in static power saving mode, processor folding is automatically enabled for both shared or dedicated processor partitions. When processor folding is enabled, the vpm_vxcpus tunable can be used to control processor folding. There are 3 bits in vpm_fold_policy to control processor folding: • Bit 0 (0x1): When set to 1, this bit indicates processor folding is enabled if the partition is using shared processors. • Bit 1 (0x2): When set to 1, this bit indicates processor folding is enabled if the partition is using dedicated processors. • Bit 2 (0x4): When set to 1, this bit disables the automatic setting of processor folding when the partition is in static power saving mode. You can perform an OR operation on the Bit 0, Bit 1, and Bit 2 values to form the desired value.
  • vpm_throughput_core_threshold — Specifies the number of cores that must be unfolded before vpm_throughput_mode parameter is honored. Till that, the system behaves with the value of vpm_throughput_mode parameter set as 1.
  • vpm_throughput_mode — Specifies the desired level of SMT exploitation for scaled throughput mode. A value of 0 gives default behavior (raw throughput mode). A value of 1, 2, or 4 selects the scaled throughput mode and the desired level of SMT exploitation.
  • vpm_xvcpus — Purpose: Setting this tunable to a value greater than -1 will enable the scheduler to enable and disable virtual processors based on the partition's CPU utilization. Tuning: The value specified signifies the number of virtual processors to enable in addition to the virtual processors required to satisfy the workload.

예제

명령 하는 일
schedo -L 모든 조정 값의 현재·재부팅 값, 범위, 단위, 유형, 의존 관계
schedo -x 같은 내용을 스프레드시트 형식으로
schedo -d v_sec_wait v_sec_wait를 기본값으로
schedo -h sched_R sched_R의 도움말
schedo -r -o v_min_process=4 다음 재부팅 뒤 v_min_process를 4로
schedo -p -D 모든 조정 값을 영구로 기본값으로 되돌림
schedo -r -a 모든 조정 값의 재부팅 값

자주 쓰는 형태:

bash
schedo -a | egrep "sched_R|sched_D|timeslice|vpm_xvcpus"
schedo -L vpm_xvcpus
schedo -p -o vpm_xvcpus=1

관련 명령어: ioo, raso, vmo, no

영어 원문
  1. To list the current and reboot value, range, unit, type and dependencies of all tunables parameters managed by the schedo command, enter: schedo -L

  2. To list (spreadsheet format) the current and reboot value, range, unit, type, and dependencies of all tunables parameters managed by the schedo command, enter: schedo -x

  3. To reset v_sec_wait to default, enter: schedo -d v_sec_wait

  4. To display help on sched_R, enter: schedo -h sched_R

  5. To set v_min_process to 4 after the next reboot, enter: schedo -r -o v_min_process=4

  6. To permanently reset all schedo tunable parameters to default, enter: schedo -p -D

  7. To list the reboot value for all schedo parameters, enter: schedo -r -a

Related information:

  • AIX compatibility mode

ioo command raso command Kernel Tuning compatibility mode

리눅스(GNU)와 다른 점

리눅스의 CFS 스케줄러는 sysctl kernel.sched_*(배포판과 커널 버전에 따라 /proc/sys/kernel/ 또는 /sys/kernel/debug/sched/)로 일부 값을 조정합니다. 프로세스별 우선순위는 nice·renice·chrt로, CPU 묶기는 taskset으로 정합니다. AIX의 메모리 부하 제어(프로세스 멈춤)에 해당하는 기능은 없고, 메모리가 모자라면 OOM killer가 프로세스를 끝냅니다.