Beginning with AIX 5.2, you can make permanent kernel-tuning changes without having to edit any rc files. This is achieved by centralizing the reboot values for all tunable parameters in the /etc/tunables/nextboot stanza file. When a system is rebooted, the values in the /etc/tunables/nextboot file are automatically applied.
The following commands are used to manipulate the nextboot file and other files containing a set of tunable parameter values:
The preceding commands work on both current and reboot values.
All five tuning commands (no, nfso, vmo, ioo, and schedo) use a common syntax and are available to directly manipulate the tunable parameter values. Available options include making permanent changes and displaying detailed help on each of the parameters the command manages.
SMIT panels and Web-based System Manager plug-ins are also available to manipulate current and reboot values for all tuning parameters, as well as the files in the /etc/tunables directory.
The following topics are covered in this chapter:
When machines are migrated to AIX 5.2 from a previous release of AIX, the tuning commands are automatically set to run in compatibility mode. Most the information in this section does not apply to compatibility mode. For more information, see Tuning Enhancements for AIX 5.2 in the AIX 5L Version 5.2 Performance Management Guide.
When a machine is initially installed with AIX 5.2, it is automatically set to run in the mode described in this article. The mode is controlled by the sys0 attribute called pre520tune, which can be set to enable to run in compatibility mode and disable to run in AIX 5.2 mode.
To retrieve the current setting of the pre520tune attribute, run the following command:
lsattr -E -l sys0
To change the current setting of the pre520tune attribute, run the following command:
chdev -l sys0 -a pre520tune=enable
OR use SMIT or Web-based System Manager.
Information about tunable parameter values is located in the /etc/tunables directory. Except for a log file created during each reboot, this directory only contains ASCII stanza files with sets of tunable parameters. These files contain parameter=value pairs specifying tunable parameter changes, classified in five stanzas corresponding to the five tuning commands : schedo, vmo, ioo, no, and nfso. Additional information about the level of AIX, when the file was created, and a user-provided description of file usage is stored in a special stanza in the file. For detailed information on the file's format, see the tunables file.
The main file in the tunables directory is called nextboot. It contains all the tunable parameter values to be applied at the next reboot. The lastboot file in the tunables directory contains all the tunable values that were set at the last machine reboot, a timestamp for the last reboot, and checksum information about the matching lastboot.log file, which is used to log any changes made, or any error messages encountered, during the last rebooting. The lastboot and lastboot.log files are set to be read-only and are owned by the root user, as are the directory and all the other files.
Users can create as many /etc/tunables files as needed, but only the nextboot file is ever automatically applied. Manually created files must be validated using the tuncheck command. Parameters and stanzas can be missing from a file. Only tunable parameters present in the file will be changed when the file is applied with the tunrestore command. Missing tunables will simply be left at their current or default values. To force resetting of a tunable to its default value with tunrestore (presumably to force other tunables to known values, otherwise tundefault, which sets all parameters to their default value, could have been used), DEFAULT can be specified. Specifying DEFAULT for a tunable in the nextboot file is the same as not having it listed in the file at all because the reboot tuning procedure enforces default values for missing parameters. This will guarantee to have all tunables parameters set to the values specified in the nextboot file after each reboot.
Tunable files can have a special stanza named info containing the parameters AIX_level, Kernel_type and Last_validation. Those parameters are automatically set to the level of AIX and to the type of kernel (UP, MP, or MP64) running when the tuncheck or tunsave is run on the file. Both commands automatically update those fields. However, the tuncheck command, will only update if no error was detected.
The lastboot file always contains values for every tunable parameters. Tunables set to their default value will be marked with the comment DEFAULT VALUE. The Logfile_checksum parameter only exists in that file and is set by the tuning reboot process (which also sets the rest of the info stanza) after closing the log file.
Tunable files can be created and modified using one of the following options:
All the tunable parameters manipulated by the tuning commands (no, nfso, vmo, ioo, and schedo) have been classified into six categories:
The manual page for each of the five tuning commands contains the complete list of all the parameter manipulated by each of the commands and for each parameter, its type, range, default value, and any dependencies on other parameters.
The no, nfso, vmo, ioo, and schedo tuning commands all support the following syntax:
command [-p|-r] {-o tunable[=newvalue]} command [-p|-r] {-d tunable} command [-p|-r] -D command [-p|-r] -a command -h tunable command -L [tunable]
-a | Displays 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 options, a value is displayed for a parameter only if its reboot and current values are equal. Otherwise, NONE is displayed as the value. |
-d tunable | Resets tunable to default value. If a tunable needs to be changed (that is, it is currently not set to its default value) and is of type Bosboot or Reboot, or if it is of type Incremental and has been changed from its default value, and -r is not used in combination, it is not changed, but a message displays instead. |
-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 are not changed, but a message displays instead. |
-h tunable | Displays help about tunable parameter. |
-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 is not changed, but a message displays
instead.
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 is displayed only if the current and next boot values for tunable are the same. Otherwise, NONE is displayed as the value. |
-p | When used in combination with -o, -d or -D,
makes changes apply to both current and reboot values; that is, turns on the
updating of the /etc/tunables/nextboot file in addition
to the updating of the current value. This flag cannot be used on Reboot and Bosboot type parameters because their
current value cannot be changed.
When used with -a or -o flag without specifying a new value, values are displayed only if the current and next boot values for a parameter are the same. Otherwise, NONE is displayed as the value. |
-r | When used in combination with -o, -d or -D flags,
makes changes apply to reboot values only; 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 are displayed instead of current values. |
-L [tunable] | Lists the characteristics of one
or all tunables, one per line, using the following format:
Name Current Default Reboot Minimum Maximum Unit Type Dependencies value value value value value ---------------------------------------------------------------------------- param1 5 2 4 1 10 MB/s I param2 param3 Parameters types are encoded with one character using the following values: D for Dynamic S for Static R for Reboot B for Bosboot M for Mount I for Incremental |
Any change (with -o, -d or -D flags) to a parameter of type Mount will result in a message displays to warn the user that the change is only effective for future mountings.
Any attempt to change (with -o, -d or -D flags ) a parameter of type Bosboot or Reboot without -r, will result in an error message.
Any attempt to change (with -o, -d or -D flags but without -r) the current value of a parameter of type Incremental with a new value smaller than the current value, will result in an error message.
The following commands can only manipulate files in the /etc/tunables directory. Therefore, all the file names specified are expanded to /etc/tunables/filename. To guarantee the consistency of their content, all the files are locked before any updates are made. The commands tunsave, tuncheck (only if successful), and tundefault -r all update the info stanza.
The tuncheck command is used to validate a file. Its syntax is as follows:
tuncheck [-r|-p] -f filename
For example, the following validates the file /etc/tunables/mytunable for usage on current values.
tuncheck -f mytunable
For example, the following validates the /etc/tunables/nextboot file for usage during reboot. Note that -r is the only valid option when the file to check is the nextboot file.
tuncheck -r -f nextboot
All parameters in the file are checked for range, and dependencies, and if a problem is detected, a message similar to: "Parameter X is out of range" or "Dependency problem between parameter A and B" is issued. The -r and -p options control the values used in dependency checking for parameters not listed in the file and the handling of proposed changes to parameters of type Incremental, Bosboot, and Reboot.
Except when used with the -r option, checking is performed on parameter of type Incremental to make sure the value in the file is not less than the current value. If one or more parameter of type Bosboot are listed in the file with a different value than its current value, the user will either be prompted to run bosboot (when -r is used) or an error message will display.
Parameters having dependencies are checked for compatible values. When one or more parameters in a set of interdependent parameters is not listed in the file being checked, their values are assumed to either be set at their current value (when the tuncheck command is called without -p or -r), or their default value. This is because when called without -r, the file is validated to be applicable on the current values, while with -r, it is validated to be used during reboot when parameters not listed in the file will be left at their default value. Calling this command with -p is the same as calling it twice; once with no argument, and once with the -r flag. This checks if a file can be used both immediately, and at reboot time.
The tunrestore command is used to restore all the parameters from a file. Its syntax is as follows:
tunrestore -R | [-r] -f filename
For example, the following will change the current values for all tunable parameters present in the file if ranges, dependencies, and incremental parameter rules are all satisfied.
tunrestore -f mytunable
In case of problems, only the changes possible will be made.
For example, the following will change the reboot values for all tunable parameters present in the file if ranges and dependencies rules are all satisfied. In other words, they will be copied to the /etc/tunables/nextboot file.
tunrestore -r -f mytunable
If changes to parameters of type Bosboot are detected, the user will be prompted to run the bosboot command.
The following can only be called from /etc/inittab and changes tunable parameters to values from the /etc/tunables/nextboot file.
tunrestore -R
Any problem found or change made is logged in the /etc/tunables/lastboot.log file. A new /etc/tunables/lastboot file is always created with the list of current values for all parameters.
If filename does not exist, an error message displays. If the nextboot file does not exist, an error message displays if -r was used. If -R was used, all the tuning parameters of a type other than Bosboot will be set to their default value, and a nextboot file containing only an info stanza will be created. A warning will also be logged in the lastboot.log file.
Except when -r is used, parameters requiring a call to bosboot and a reboot are not changed, but an error message is displayed to indicate they could not be changed. When -r is used, if any parameter of type Bosboot needs to be changed, the user will be prompted to run bosboot. Parameters missing from the file are simply left unchanged, except when -R is used, in which case missing parameters are set to their default values. If the file contains multiple entries for a parameter, only the first entry will be applied, and a warning will be displayed or logged (if called with -R).
The tunsave command is used to save current tunable parameter values into a file. Its syntax is as follows:
tunsave [-a|-A] -f|-F filename
For example, the following saves all the current tunable parameter values different from their default into the file /etc/tunables/mytunable.
tunsave -f mytunable
If the file already exists, an error message is printed instead. Option -F must be used to overwrite an existing file.
For example, the following saves all the current tunable parameter values different from their default into the file /etc/tunables/nextboot.
tunsave -f nextboot
If necessary, tunsave will prompt the user to run bosboot.
For example, the following saves all current tunable parameters values (including parameters which value is their default value) into the mytunable file.
tunsave -A -f mytunable
This allows you to save the current setting. This setting can be reproduced at a later time, even if the default values have changed (default values can change when the file is used on another machine or when running another version of AIX).
For example, the following saves all current tunable parameters values into the mytunable file.
tunsave -a -f mytunable
For the parameters that are set to default values, a line using the keyword DEFAULT will be put in the file. This essentially saves only the current changed values, while forcing all the other parameters to their default values. This allows you to return to a known setup later using tunrestore.
The tundefault command is used to force all tuning parameters to be reset to their default value. The -p flag makes changes permanent, while the -r flag defers changes until the next reboot. The command syntax is as follows:
tundefault [-p|-r]
For example, the following resets all tunable parameters to their default value, except the parameters of type Bosboot and Reboot, and parameters of type Incremental set at values bigger than their default value.
tundefault
Error messages will be displayed for any parameter change that is not permitted.
For example, the following resets all the tunable parameters to their default value. It also updates the /etc/tunables/nextboot file, and if necessary, offers to run bosboot, and displays a message warning that rebooting is needed for all the changes to be effective.
tundefault -p
This command permanently resets all tunable parameters to their default values, returning the system to a consistent state and making sure the state is preserved after the next reboot.
For example, the following clears all the command stanzas in the /etc/tunables/nextboot file, and proposes bosboot if necessary.
tundefault -r
Installing the bos.perf.tune fileset automatically creates an initial /etc/tunables/nextboot file and adds the following line at the end of the /etc/inittab file:
tunable:23456789:once:/usr/bin/tunrestore -R
This entry sets the reboot value of all tunable parameters to their default. For more information about migration from a previous version of AIX and the compatibility mode automatically setup in case of migration, read "Introduction to AIX 5.2 Tunable Parameter Settings" in the AIX 5L Version 5.2 Performance Management Guide.
Parameters of type Bosboot are set by the bosboot command, which retrieves their values from the nextboot file when creating a new boot image. Parameters of type Reboot are set during the reboot process by the appropriate configuration methods, which also retrieve the necessary values from the nextboot file. In both cases, if there is no nextboot file, the parameters will be set to their default values. All other parameters are set using the following process:
Both these conditions could exist if a user modified the /etc/tunables/nextboot file with an editor or copied it from another machine, possibly running a different version of AIX with different valid ranges, and did not run tuncheck -r -f on the file. Alternatively, tuncheck -r -f prompted the user to run bosboot, but this was not done.
If the machine becomes unstable with a given nextboot file, users should put the system into maintenance mode, make sure the sys0 pre520tune attribute is set to disable, delete the nextboot file, run the bosboot command, move the tunable line to be last in /etc/inittab and reboot. This action will guarantee that all tunables are set to their default value.
To start the SMIT panels that manage AIX kernel tuning parameters, use the SMIT fast path smitty tuning. The following is a view of the tuning panel:
Tuning Kernel Parameters
Save/Restore All Kernel & Network Parameters
Tuning Scheduler and Memory Load Control Parameters
Tuning Virtual Memory Manager Parameters
Tuning Network Parameters
Tuning NFS Parameters
Tuning I/O Parameters
Select Save/Restore All Kernel & Network Parameters to manipulate all tuning parameter values at the same time. To individually change tuning parameters managed by one of the tuning commands, select any of the other lines.
The main panel to manipulate all tunable parameters by sets looks similar to the following:
Save/Restore All Kernel Tuning Parameters
View Last Boot Parameters
View Last Boot Log File
Save All Current Parameters for Next Boot
Save All Current Parameters
Restore All Current Parameters from Last Boot Values
Restore All Current Parameters from Saved Values
Reset All Current Parameters To Default Value
Save All Next Boot Parameters
Restore All Next Boot Parameters from Last Boot Values
Restore All Next Boot Parameters from Saved Values
Reset All Next Boot Parameters To Default Value
Each of the options in this panel are explained in the following sections.
Save All Current Kernel Tuning Parameters for Next Boot
ARE YOU SURE ?
After selecting yes and pressing ENTER, all the current tuning parameter values are saved in the /etc/tunables/nextboot file. Bosboot will be offered
if necessary. Save All Current Kernel Tuning Parameters
File name []
Description []
Type or select values for the two entry fields:
Restore All Current Parameters from Last Boot Values
ARE YOU SURE ?
After selecting yes and pressing ENTER, all the tuning parameters will be set to values from the /etc/tunables/lastboot file. Error messages will be displayed if any
parameter of type Bosboot or Reboot would need to be changed, which can only be done when changing reboot
values. Restore Saved Kernel Tuning Parameters
Move cursor to desired item and press Enter.
mytunablefile Description field of mytunable file
tun1 Description field of lastweek file
A select menu shows existing files in the /etc/tunables directory, except the files nextboot, lastboot and lastboot.log which all have special
purposes.
Reset All Current Kernel Tuning Parameters To Default Value
ARE YOU SURE ?
After pressing ENTER, each tunable parameter
will be reset to its default value. Parameters of type Bosboot and Reboot, are never changed, but error messages
are displayed if they should have been changed to get back to their default
values. Save All Next Boot Kernel Tuning Parameters
File name []
Type or a select values for the entry field. F4 will show the list
of existing files. This is the list of all files in the /etc/tunables directory except the files nextboot, lastboot and lastboot.log which all
have special purposes. File names entered cannot be any of those three reserved
names.
Restore All Next Boot Kernel Tuning Parameters from Last Boot Values
ARE YOU SURE ?
After selecting yes and pressing ENTER, all values from the lastboot file will be
copied to the nextboot file. If necessary, the user
will be prompted to run bosboot, and warned that for
all the changes to be effective, the machine must be rebooted. Restore All Next Boot Kernel Tuning Parameters from Saved Values
Move cursor to desired item and press Enter.
mytunablefile Description field of mytunablefile file
tun1 Description field of tun1 file
A select menu shows existing files in the /etc/tunables directory, except the files nextboot, lastboot and lastboot.log which all have special
purposes.
Reset All Next Boot Kernel Tuning Parameters To Default Value
ARE YOU SURE ?
After hitting ENTER, the /etc/tunables/nextboot file will be cleared. If necessary bosboot will be proposed and a message indicating that a reboot is needed
will be displayed.All the panels for all five commands behave the same way. In the following sections, we will use the example of the Scheduler and Memory Load Control (i.e. schedo) panels to explain the behavior. Here is the main panel to manipulate parameters managed by the schedo command:
Tuning Scheduler and Memory Load Control Parameters
List All Characteristics of Current Parameters
Change / Show Current Parameters
Change / Show Parameters for next boot
Save Current Parameters for Next Boot
Reset Current Parameters to Default value
Reset Next Boot Parameters To Default Value
The following table contains the different parameters and how they relate to the different SMIT sub-panels:
List All Characteristics of Current Parameters | Lists current, default, reboot, limit values, unit, type and dependencies. This is the output of a tuning command called with the -L option. |
Change / Show Current Parameters | Displays and changes current parameter value, except for parameter of type Static, Bosboot and Reboot which are displayed without surrounding square brackets to indicate that they cannot be changed. |
Change / Show Parameters for Next Boot | Displays values from and rewrite updated values to the nextboot file. If necessary, bosboot will be proposed. Only parameters of type Static cannot be changed (no brackets around their value). |
Save Current Parameters for Next Boot | Writes current parameters in the nextboot file, bosboot will be proposed if any parameter of type Bosboot was changed. |
Reset Current Parameters to Default value | Resets current parameters to default values, except those which need a bosboot plus reboot or a reboot (B and R type). |
Reset Next Boot Parameters to Default value | Clears values in nextboot file, and propose bosboot if any parameter of type Bosboot was different from its default value. |
Each of the sub-panels behavior is explained in the following sections:
Change / Show Current Scheduler and Memory Load Control Parameters
[Entry Field]
affinity_lim [7]
idle_migration_barrier [4]
fixed_pri_global [0]
maxspin [1]
pacefork [10]
sched_D [16]
sched_R [16]
timeslice [1]
%usDelta [100]
v_exempt_secs [2]
v_min_process [2]
v_repage_hi [2]
v_repage_proc [6]
v_sec_wait [4]
This panel is initialized with the current schedo values (output from the schedo -a command). Any
parameter of type Bosboot, Reboot or Static is displayed with no surrounding square bracket indicating
that it cannot be changed.
Change / Show Scheduler and Memory Load Control Parameters for next boot
[Entry Field]
affinity_lim [7]
idle_migration_barrier [4]
fixed_pri_global [0]
maxpin [1]
pacefork [10]
sched_D [16]
sched_R [16]
timeslice [1]
%usDelta [100]
v_exempt_secs [2]
v_min_process [2]
v_repage_hi [2]
v_repage_proc [6]
v_sec_wait [4]
This panel is similar to the previous panel, in that, any parameter
value can be changed except for parameters of type Static. It is initialized with the values listed in the /etc/tunables/nextboot file, completed with default values for the parameter not listed in
the file.
Save Current Scheduler and Memory Load Control Parameters for Next Boot
ARE YOU SURE ?
After pressing ENTER on this panel, all the
current schedo parameter values will be saved in the /etc/tunables/nextboot file . If any parameter of type Bosboot needs to be changed, the user will be prompted to
run bosboot. Reset Current Scheduler and Memory Load Control Parameters to Default Value
ARE YOU SURE ?
After selecting yes and pressing ENTER on this panel, all the tuning parameters managed by the schedo command will be reset to their default value. If any parameter
of type Incremental, Bosboot or Reboot should have been changed, and error message will
be displayed instead. Reset Next Boot Parameters To Default Value
ARE YOU SURE ?
After pressing ENTER, the schedo stanza in the /etc/tunables/nextboot file
will be cleared. This will defer changes until next reboot. If necessary, bosboot will be proposed.AIX kernel tuning parameters can be managed using the Web-based System Manager System Tuning Plug-in, which is a sub-plugin of the Web-based System Manager2000 Performance plug-in. The Performance Plug-in is available from the Web-based System Manager main console which looks similar to the following:
The Performance plug-in is organized into the following sub-plugins:
The Performance Monitoring sub-plugin gives access to a variety of performance-monitoring and report-generation tools. The System Tuning sub-plugin consists of CPU, Memory, Disk I/O, and Network I/O sub-plugins, which present tuning tables from which AIX tuning parameters can be visualized and changed.
The Navigation Area for the System Tuning plug-in contains three levels of sub-plugins as seen in the following:
These intermediate levels represent tuning resources. They are further split into sub-plugins but have no specific actions associated with them and only exist to group access to tunable parameters in a logical way. Actions on tunable parameters can be applied at the following levels:
The CPU/All Processes sub-plugin is a link to the All Processes sub-plugin of the Processes application. Its purpose is not to manipulate tuning parameters and will not be discussed.
Only the Web-based System Manager Tuning menu has specific actions associated with it.
The specific actions available at this level are global, in that they apply to all the performance tunable parameters.
Each tuning table in the content area has the same structure. It allows all the characteristics of the tunable parameters to be viewed at a glance. The table is editable using the New Value column. Each cell in the New Value column, is an editable combobox, with only one predefined value of Default, for the capture of new value for a parameter. Data entered in the New Value column is validated when pressing ENTER.
The parameters are grouped as they are in the SMIT panels with two small exceptions. First, the Network related parameters are all presented in one SMIT panel, but subdivided in six sections. The Web-based System Manager interface uses six separate tables instead.
Lastly, the parameters managed by the schedo command are available from two sub-plugins: CPU/scheduling and memory/scheduling.
Actions allowed vary according to parameter types:
The following section explains in detail the behavior of the tables.
The actions available for each tunable table are Save Changes, Save Current Parameters for Next Boot, Reset Parameters to System Default, Parameter Details, and Monitor. The Monitor action enables related monitoring tools to start from each of the plug-ins and is not discussed in this section.
Clicking on Parameter Details in the toolbar or selecting the equivalent menu item, followed by a click on a parameter in the table will display the help information available in a help dialog..
/etc/tunables/lastboot | Contains tuning parameter stanzas from the last boot. |
/etc/tunables/lastboot.log | Contains logging information from the last boot. |
/etc/tunables/nextboot | Contains tuning parameter stanzas for the next system boot. |
The bosboot, ioo, nfso, no, schedo, tunsave, tunrestore, tuncheck, tundefault, and vmo commands.
The tunables file.