Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > k

kmtune(1M)

HP-UX 11i Version 1.6: June 2002
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

kmtune — query, set, or reset system parameters

SYNOPSIS

/usr/sbin/kmtune [-d] [-l] [[-q name]...] [-S system_file]

/usr/sbin/kmtune [[-q name]...]

/usr/sbin/kmtune [-u] [[-s name {=|+}value]...] [[-r name]...] [-c comment] [-S system_file]

/usr/sbin/kmtune [[-e value]...]

DESCRIPTION

kmtune is used to query, set, or reset system parameters. kmtune displays the planned values of all system parameters when used without any options or with the -S or -l option. kmtune reads traditional and modular kernel configuration files. See config(1M), master(4) and system(4). It also gathers information on the running kernel using the tuneinfo2() system call.

Unless the -u option is specified, kmtune's changes do not take effect immediately. Changes to system parameters not associated with dynamically loadable kernel modules do not take effect until the kernel has been rebuilt and the system has been rebooted. Changes to parameters associated with dynamically loadable kernel modules do not take effect until the module is re-configured and registered with the running kernel. See config(1M) and kmupdate(1M).

Options

The following options are recognized by kmtune:

-c text

Specify an optional comment string. All changes to the kernel parameters are logged with the date, old value, new value, user id and this comment. This option is used with -r and -s. The comment text will generally need to be quoted so that it is interpreted as a single parameter by the shell. The comment text may contain newlines. The log is written to the file /var/adm/kc.log. The format of the log file is subject to change in the future.

-d

Print a brief difference report. Only parameters where the planned and current values are different are listed. If the planned value is a formula, it is NOT considered different from the current value. This option is useful to insure that only desired changes will be made on a subsequent invocation of kmtune -u. The -d option cannot be used with the -r, -s, or -u options.

-e value

Evaluate the expression given by "value". The expression is anything allowed in the -s option. The output will always be in decimal.

-l

Print a detailed report. The -l option cannot be used with the -r, -s or -u options.

-q name

Query the value of the specified system parameter.

-r name

Reset the value of the specified system parameter to the default.

-s name{=|+}value

Set the value of the specified system parameter. If the separator is an equal sign (=), the parameter is set to the value specified. If the separator is a plus sign (+), the parameter is incremented by the value specified. Negative values cannot be used with plus sign (+). The name{=|+}value format must not include spaces or tabs.

-S system_file

Specify the HP-UX system description file name (traditional system file). If not specified, /stand/system is used as the default.

-u Update the currently running kernel. This modifies the -s and -r options, to update the running kernel as well as the system files. The values specified must be numeric. The whole command will fail if any non dynamic parameters are being set. The -s and -r options are processed in the order they are listed. When incrementing a value with the -s option the kernel and the system files are set to the value in the system file plus the increment value.

When used alone, or with -S, it updates all the dynamic parameters to match the numeric values stored in the system files. A warning is reported if any static parameters have differences. The order the parameters are listed in the system files is not important. The -d option can be used to look at the differences to get a preview of what a lone -u will do.

Use of -u requires super user privileges.

If the -q query option is specified, kmtune displays the following format:

Brief report without -l option

Parameter Current Dyn Planned Module ============================================================ name value — value [module]

Detailed report with -l option

Parameter: name Description: one line description of the parameter Current: current value from the running kernel Planned: expression for the planned setting Value: integer evaluation of the planned expression Default: default value Minimum: minimum Maximum: maximum Module: module Dynamic: Yes/No

If the -l option is specified without the -q query option, a detailed report on all the parameters is displayed. The information between the parameters is separated by blank lines.

Any values not returned by the kernel or read from a master file, will be displayed as '-' (dash).

In the brief report, the Module field is blank unless the parameter is associated with a packaged module. See config(1M). In the detailed report, the Module field is '-' unless the parameter is associated with a packaged module.

The Current field is an integer read from the running kernel. The Planned field contains the value last set with the -s (or -r) options. It may be a formula, or a literal. The Value field is an integer computed from the Pending string. This value is what the parameter would be set to if mk_kernel were run. Formulas are evaluated using the Value field of any other parameters used in the formula.

The Dynamic field, in the -l output, is either "Yes" or "No." Parameters that are dynamic can be changed without rebooting. Changing other parameters requires rebooting. In the brief listing "Y" is used to indicate dynamic parameters.

If the -s set option is specified and the minimum or maximum value of the parameter is returned by the kernel or described in its master file, the value range is checked. If the minimum and maximum values are printed as a dash in the long listing then no range check is made.

The expressions used with the -s and -e options are built of literal values, the upper case names of other kernel parameters, and the following operators: ( and ), the unary operators ~, !, -, and +, the binary operators *, /, %, +, -, <<, >>, <, <=, >, >=, &, ~, |, ==, !=, &&, and ||, and the ternary operator ?:.

Using -s to create a circular dependency in the values of the kernel parameters is not allowed.

NOTES

System administrators must use kmsystem(1M) and kmtune(1M) instead of editing files manually. The format of kernel configuration files is subject to change, and kmtune is intended to provide compatibility in case of format change. See config(1M), master(4) and system(4).

Changing kernel parameters dynamically is a fairly new feature. Programs using pstat(2), getrlimit(2), or sysconf(2) may have been written with the previously correct assumption that the returned values do not vary while the system is running. The use of kmtune to modify the running kernel may cause such programs to produce erroneous results or even abort.

Some dynamic kernel parameters can be raised dynamically, but cannot be lowered without rebuilding the kernel and rebooting. See the man pages for those parameters for details.

When dynamically lowering per-process limits, processes that exceed the new limit will be "grandfathered". Such processes will retain the old limit. The old limit will also apply to any child processes they create after the change. Some parameters have exceptions to this general policy; see the man pages for those parameters for details.

It is possible to put multiple -s and -r options on a single kmtune command. kmtune will try to make all of the changes, in the order listed. If an error occurs with one of the changes, the state of the other changes is not defined.

RETURN VALUE

Upon completion, kmtune returns with one of the following exit values:

0

Successful.

1

Requested parameter is not found, the value is out of range, or the format of the value is not valid.

2

Syntax error.

3

Changes in static parameters were found when trying to dynamically update the running kernel.

>3

Environmental error.

Results of query requests are sent to stdout. Error and warning messages are sent to stderr.

EXAMPLES

# kmtune -q shmseg Parameter Current Dyn Planned Module ================================================ shmseg 120 Y 120 # kmtune -s 'shmseg=(SHMMNI)' -c 'request from Leslie Maxwell' # kmtune -l -q shmseg Parameter: shmseg Description: Shared Memory Segments Per Process Current: 200 Planned: (SHMMNI) Value: 200 Default: 120 Minimum: 1 Maximum: 200 Module: - Dynamic: Yes # kmtune -r shmseg # kmtune -d Parameter Current Dyn Planned Module ================================================ shmseg 200 Y 120

FILES

/usr/conf/master.d/*

Traditional and modular master configuration files

/stand/system

Default HP-UX system description file (traditional system file)

/stand/system.d/*

Modular system files

/var/adm/kc.log

Log of all tunable changes made using kmtune

SEE ALSO

config(1M), kmsystem(1M), settune(2), tuneinfo2(2), master(4), system(4), and the individual tunable parameter man pages in section 5.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2002 Hewlett-Packard Development Company, L.P.