2.1 HP-UX操作系统
2.1.1 HP-UX 11.23内核参数设置标准
请遵循以下标准设置HP-UX 11.23内核参数。
2.1.2 HP-UX内核参数设置方法
为安全起见,请统一使用SAM进行HP-UX的内核参数设置。
1. HP-UX 11.23设置方法
【启动SAM命令】
# set term=vt100
# sam
启动后选择:
Kernel Configuration => Kernel Configuration(character mode) => View or modify
kernel tunables
在参数列表中找到相应的参数,点击m键,依据上述标准进行参数的修
改。
HP内核参数分为动态和静态两种,Dynamic显示为“yes”的是动态参数,
修改后立即生效;Dynamic显示为“no”的是静态参数,修改后必须重启
才能生效。
【参数列表示例】
---------------------------------------------------------------------
Current Planned Dynamic Auto Tuning
Value Value
=====================================================================
NSTREVENT 50 50 no
aio_listio_max 256 256 yes
【示例:设置动态参数aio_max_ops(HP-UX11.11是静态参数)】
SAM -> Kernel Configuration -> Tunable -> Modify (aio_max_ops)
-----------------------------------------------------------------
Tunable aio_max_ops
Description Maximum number of async IO operations that can be queued at any time
Dynamic yes
Subsystem io
Default Value 2048
Current Value 1000
Planned Value 1000
Last Boot Value 1000
Constraints aio_max_ops >= 2
Constraints aio_max_ops <= 1048576
Constraints aio_max_ops >= aio_listio_max
Auto Tuning Not Supported
Enter Value/Expression OR q(quit) = 2048
Do you want to hold this change till next boot ? (y/n/q)[y] = n
Do you want to save the current kernel configuration ? (y/n/q)[y] = y Enter Comments =
Command Preview: /usr/sbin/kctune -B aio_max_ops=2048
Do you want to proceed ? (y/n) [n] = y
* The automatic 'backup' configuration has been updated.
* The requested changes have been applied to the currently
running system.
press enter to continue...
回车,可以看到Current Value和Planned Value的值都为2048,说明此修改已经生效。
【说明】
Current Value:参数当前生效的值
Planned Value:参数在下次系统重启后生效的值
Current Planned Dynamic Auto Tuning
Value Value
========================================================================= aio_max_ops 2048 2048 yes
【示例:设置动态参数aio_max_ops】
SAM -> Kernel Configuration -> Tunable -> Modify (max_async_ports)
-----------------------------------------------------------------
Tunable max_async_ports
Description Maximum number of open asyncdsk ports
Dynamic no
Subsystem io
Default Value 50
Current Value 1000
Planned Value 1000
Last Boot Value 1000
Auto Tuning Not Supported
Enter Value/Expression OR q(quit) = 2048
Do you want to save the current kernel configuration ? (y/n/q)[y] = y
Enter Comments =
Command Preview: /usr/sbin/kctune -h -B max_async_ports=2048
Do you want to proceed ? (y/n) [n] = y
* The automatic 'backup' configuration has been updated.
* The requested changes have been saved, and will take effect at next boot.
press enter to continue...
回车,可以看到Current Value值仍为1000,Planned Value值为2048,说明此修改没有生效,需要重启操作系统。
Current Planned Dynamic Auto Tuning
Value Value
===================================================================== max_async_ports 1000 2048 no
使用以下命令进行重启:
# shutdown -ry 0
重启后再进入SAM进行观察,或使用以下命令进行确认:
# /usr/sbin/kmtune | grep max_async_ports
建议,在修改完全部内核参数以后,使用kmtune对所有内核参数都进行一次确认:
# /usr/sbin/kmtune。