[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Versions 3.2 and 4 Performance Tuning Guide

schedtune Command

Purpose

Sets parameters for CPU scheduler and Virtual Memory Manager processing.

Syntax

schedtune [ -D | { [ -d n ] [ -e n ] [ -f n ] [ -h n ] [ -m n ] [ -p n ] [ -r n ] [ -t ] [ -w n ] } ]

Description

Priority-Calculation Parameters

The priority of most user processes varies with the amount of CPU time the process has used recently. The CPU scheduler's priority calculations are based on two parameters that are set with schedtune: -r and -d. The r and 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 CPU use is:

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

and the once-per-second recalculation of the recently used CPU value of each process is:

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

Both r and d have default values of 16. This maintains the CPU scheduling behavior of previous versions of AIX. Before experimenting with these values, you should be familiar with "Tuning the Process-Priority-Value Calculation with schedtune".

Memory-Load-Control Parameters

The AIX scheduler performs memory load control by suspending processes when memory is overcommitted. 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 overcommitted 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 -h flag, and s is the number of page steals that have occurred in the last second.

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

r * p > f where r is the number of repages that the process has accumulated in the last second, p is an integer specified by the -p flag, and 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 -m flag. 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 overcommitted threshold for n seconds, where n is specified by the -w flag. 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 should be thoroughly familiar with "Tuning VMM Memory Load Control".

Time-Slice-Increment Parameter

The schedtune 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 -t flag of the schedtune command 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 with Local or Global Contention Scope".

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 schedtune -f flag.

schedtune Limitations

schedtune can only be executed by root . Changes made by the schedtune command last until the next reboot of the system. If a permanent change in VMM or time-slice parameters is needed, an appropriate schedtune command should be put in /etc/inittab.

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

Flags

If no flags are specified, the current values are printed.

-D Restores the default values (d=16, e=2, f=10, h=6, m=2, p=4, r=16, t=0, w=1).
-d n Each process's recently used CPU value is multiplied by d/32 once a second.
-e n Specifies that a recently resumed suspended process is eligible to be suspended again when it has been active for at least n seconds.
-f n Specifies the number of (10-millisecond) clock ticks to delay before retrying a fork call that has failed because of insufficient paging space. The system retries the fork call up to five times .
-h n Specifies the systemwide criterion for determining when process suspension begins and ends. A value of zero effectively turns off memory load control.
-m n Sets the minimum multiprogramming level.
-p n Specifies the per-process criterion for determining which processes to suspend.
-r n A process's recently used CPU value is multiplied by r/32 when the process's priority value is recalculated.
-t n Increases the duration of the time slice--the maximum amount of time before another process is scheduled to run. The default time-slice duration is 10 milliseconds. The parameter n is in units of 10 milliseconds each. If n=0, the time-slice duration is 10 milliseconds. If n=2, the time-slice duration is 30 milliseconds. In AIX Version 4, this parameter only applies to threads with the SCHED_RR scheduling policy
-w n Specifies the number of seconds to wait, after thrashing ends, before reactivating any suspended processes.
-? Displays a brief description of the command and its parameters.

Related Information

The fork subroutine.

"Real-Memory management".

"Tuning the Process-Priority-Value Calculation with schedtune".

"Tuning VMM Memory Load Control".


[ Previous | Next | Contents | Glossary | Home | Search ]