Tips and Tricks Submission - Kernel Tuning parameters for the HP-9000

altquark

altquark

Legendary Poster
Heres a couple of Kernel Tuning tricks to look into - maybe other HP-UX gurus out there might add to this ?


All of the kernel settings in HP-UX are accessible from a console or a telnet session through SAM - I am not sure where SAM actually saves the configuration files (can someone explain how to "print off" all the kernel configs ?).

To change kernel parameters - run SAM from the command line as ROOT, go to "Kernel Configuration" then to "Configurable Parameters" - to save the kernel, ensure that you pull down the "Actions" menu and "Process New Kernel" which usually requires a reboot.

Common parameters that often get changed are as follows :

Shared Memory :
SHMMAX: Maximum size in bytes of a shared memory segment
SHMMIN: Minimum size in bytes of a shared memory segment
SHMMNI: Number of shared memory identifiers
SHMSEG: Number of shared memory segments per process
Set the value of SHMMAX to the maximum size of the Oracle SGA (System Global Area) so that the SGA can fit into one contiguous shared memory segment. Do not set SHMMAX to an amount larger than the amount of physical memory (RAM).

Semaphore Parameters :

SEMMNS: Maximum number of semaphores in system
SEMMNI: Number of semaphore identifiers
SEMMAP: Maximum number of semaphore map entries
You can monitor semaphore activities by using the sar -m command.

If you are running Websphere on your HP-UX system, then you will also need to set the maxfiles and maxfiles_lim parameters to at least 4096. (Usually, you will probably set it to the recommended values of 8000 and 8196, respectively. You must first edit the /usr/conf/master.d/core-hpux file, so the SAM utility can set values greater than 2048:

1. Open the /usr/conf/master.d/core-hpux file in a text editor.
2. Change the line," *range maxfiles<=2048" to "*range maxfiles<=60000"
3. Change the line, "*range maxfiles_lim<=2048" to "*range maxfiles_lim<=60000"
4. Save and close the file. Old values might be stored in the /var/sam/boot.config file. Force the SAM utility to create a new boot.config file:
1. Move the existing version of the /var/sam/boot.config file to another location, such as the /tmp directory.
2. Start the SAM utility.
3. Select Kernel Configuration > Configurable Parameters. When the Kernel Configuration window opens, a new boot.config file exists.

Alternatively, rebuild the boot.config file with the following command: # /usr/sam/lbin/getkinfo -b

For Websphere, the following Kernel Parameters ALSO need to be changed :

Parameter Value
STRMSGSZ 65535
dbc_max_pct 25
maxdsiz 805306358 (0x30000000)
maxdsiz 2048000000 (when running multiple profiles on the same system)
maxfiles_lim 8196 (Change this one before maxfiles.)
maxfiles 8000
maxssiz 8388608
maxswapchunks 8192
max_thread_proc 3000
nproc 4116 (Change this one before maxuprc)
maxuprc 512
maxusers 512
msgtql 2046
msgmap 2048
msgssz 32 (Change this one before msgmax)
msgseg 32767 (Change this one before msgmax)
msgmnb 65535 (0x10000) (Change this one before msgmax)
msgmnb 131070 (when running multiple profiles on the same system)
msgmax 65535 (0x10000)
msgmax 131070 (when running multiple profiles on the same system)
msgmni 50
nfile 58145
nflocks 3000
ninode 60000
nkthread 7219
npty 2024
nstrpty 1024
nstrtel 60
sema 1
semaem 16384 (0x4000)
semmns 16384 (0x4000) (Change this one before semmap)
semmni 2048 (Change this one before semmap)
semmap 514
semmnu 1024
semume 200
semvmx 32767
shmem 1
shmmax 2147483647 (0x7fffffff)
shmmni 1024
shmseg 1024

Obviously, the above settings might not be exactly correct for your machine - you will likely need to identify how much memory your HP9000 has installed (Select Performance Monitors > System Properties > Memory from SAM) prior to changing the above values, and will use this value to correctly identify the values.
 
Jon,

try "kmtune" with no option flags. kmtune by default will display all kernel parms. For instance,

# kmtune | grep shm
core_addshmem_read 0 Y 0
core_addshmem_write 0 Y 0
shmem 1 - 1
shmmax 0x40000000 Y 0X40000000
shmmni 1024 - 1024
shmseg 1024 Y 1024

Also, you can change parms using this tool (see the manpage for kmtune) but it is generally recommended to make your changes using SAM. These values are stored in the HFS filesystem /stand. If you make a change, check the /stand/system using tail and you should see your change (i.e. update maxswapchunks to 1024 using SAM or kmtune, then "tail /stand/system" and you should see at the bottom of system a line like:

maxswapchunks 1024

Reboot and it will take affect. A nice thing about HP-UX 11i v1 and v2 is the addition of more "dynamic tunables". In some cases you can adjust a kernel parm on the fly without a reboot, but in others you may have a dynamic tunable which is dependent on a prerequisite tunable having already been set to an arbitrary value.
 
Back
Top