[HP Electronic Support Center] ESC Main User Info What's New Logout About Name: Troy Page User ID: CA22606 ---------------------------------------------------------------------- [Search Screen][Search Results][Search History][Document Display] Document Text Title : SYS ADM: HP-UX kernel variables and performance tuning Date : 980618 Type : EN Document ID : KNC061098001 ------------------------------------------------------------------------ PROBLEM TEXT Where can I find general information on common HP-UX kernel variables and associated performance tuning? DETAIL TEXT Operating System - HP-UX Hardware System - HP 9000 RESOLUTION TEXT The following information is a general overview of HP-UX kernel parameters and associated tips on performance tuning. More detailed information can be obtained from the HP knowledge database and some variables are further explained in the Release Notes located in /usr/share/doc. Not all parameters are addressed in this document. acctresume and acctsuspend Used only when HP-UX accounting is enabled. These variables are percentages of the filesystem where the accounting log files reside (/var/adm by default). Accounting is suspended when filesystem free space drops below the percentage assigned to acctsuspend (an absolute percentage). It is only resumed when the free percentage assigned to acctresume is achieved. For example: acctsuspend assigned 0 (assuming default filesystem values) - accounting will be suspended when free space drops below minfree (10% by default. The filesystem will show 100% used in the bdf output). If acctresume is 80, accounting will once again be enabled when filesystem utilization drops to 80% (as seen with bdf). When accounting is re-enabled, an "Accounting resumed" message will be generated. For additional information, refer to the Account Whitepapers listed in /usr/share/doc/doc_map.txt and the accounting man pages. bufpages This value was historically used to define the amount of physical memory (in 4096 byte pages) to be allocated for the buffer cache used in filesystem IO. Prior versions of HP-UX typically used 10% of physical memory for this task, but recent versions have implemented a dynamic allocation of memory. In version 10.X, if bufpages is a non-zero value, it becomes the maximum value of memory pages available for the buffer cache. This in essence becomes a cap where, although less may be used, the value will not be exceeded. In version 10.X bufpages is often set to 0 which indicates a dynamic buffer cache is invoked and that the dbc_min_pct and dbc_max_pct parameters will set the minimum and maximum percentages of available memory allowed for a buffer cache. In version 9.X, memory for buffer cache was explicitly determined with the bufpages variable. If this variable was missing from either /etc/conf/dfile (series 700) or /etc/conf/gen/S800 (series 800), buffer cache was set to 10% of available memory; otherwise, the value was entered in pages (4096 bytes). create_fastlinks Allows creation of fast symbolic links within the HFS filesystem. Additional information should be examined in the Release Notes. Essentially, fast symbolic links reduce disk block accesses, thus reducing disk IO slightly. * Note: This variable was not present on 800 systems prior to 10.0 or 700 series prior to 9.0. dbc_max_pct and dbc_min_pct These two variables define the range of the percentage of memory available to buffer filesystem pages also known as buffer cache. Optimal values typically result in - less than or equal to 95% read cache hit ratios - less than or equal to 70% write cache hit ratios The values can be monitored with sar -b 5 5 (%rcache and %wcache, respectively). Read cache hit reduction may be warranted. Another symptom of excessive memory for caching may be unexplained occasional or periodic pauses in user response time. Default values are 5 for dbc_min_pct and 50 for dbc_max_pct. In many instances, it is advised to allocate 200mb of memory or less to buffer cache. Dbc_max_pct is a prime candidate for reduction on machines where memory pressures are observed and the pauses described are noticed. default_disk_ir Disk immediate reporting. This variable determines whether a write() system call will wait for the data to be written physically to the disk or only to disk cache. Default action is disabled indicating the write() will be satisfied by writing to disk and not the disk cache. Additional information is available in the Release Notes. fs_async Enables asynchronous filesystem writes. Though this may improve filesystem performance in certain instances, the window for corruption to the filesystem is greater. Additional methods of insuring data integrity are advised. Alter this variable with caution. This variable is relevant only to filesystems. It is not relevant to raw disk devices or raw lvols. maxdsiz, maxssiz, and maxtsiz These parameters are the three basic components of all HP-UX user processes (data, stack, and text segments). The maximum size for the data segment is 1.9 gigabytes, but this value requires that the executable be compiled and linked with EXEC_MAGIC (for more information refer to the ld(1) man page option -N and Release Notes). EXEC_MAGIC eliminates the ability for several processes to share the same memory image of the code. Without EXEC_MAGIC, the maximum value of maxdsiz is approximately 966 megabytes. If per process data segments (maxdsiz) are in excess of this value, then the binaries must be at least relinked with ld(1) or recompiled so EXEC_MAGIC is set. See ld(1) and current revision of Release Notes for additional detail. Note: Version 10.10 did enhance EXEC_MAGIC such that the text image may be shared between multiple processes. Please reference the man pages and Release Notes for more detail. maxfiles & maxfiles_lim This variable pertains to the soft and hard limit for the maximum number of files a process may have open at one time. The default for maxfiles is 60, but since all interactive processes open stdin, stdout, and stderr, only 57 more files can usually be opened. Non-root processes (uid > 0) may increase the soft limit up to the hard limit of maxfiles_lim, but only by utilizing the setrlimit(2) system call. Otherwise, the only method of increasing the soft limit is to change the value of maxfiles. maxswapchunks This value pertains to the number of swapchunks (swchunk) available for allocation. Since swap is allocated in swapchunks, this variable must be large enough to access all of swap. The default value of 256 allows for approximately 525 MB of swap to be allocated. If this value is too small for the configured swap space, unreachable swap is typically marked as reserved and not accessible. This limits swap space and virtual memory overall. The cost of this variable in terms of memory is inconsequential. Setting maxswapchunks to 1024 or 2048 will allow the kernel to address a far greater swap area than most configurations will require. maxuprc This value determines the number of processes a user ID is able to spawn. This is a limiting factor for each UID regardless of the number of logins. Large values for maxuprc can create an environment where a runaway user process can consume large amounts of processor time due to indiscriminate process spawning. It may also influence other kernel variables that may result in degraded throughput of the machine. Caution is advised when increasing this variable. maxusers Contrary to some beliefs, this variable has nothing to do with the number of users allowed to log into HP-UX. The main function of this variable is similar to maxuprc--an input variable for an even larger number of kernel formulas. Most often, changes are not needed for this variable. It is advisable to focus on the specific kernel resource that requires modification. maxvgs This parameter refers to the maximum number of volume groups configurable under current kernel configuration. The default value is 10. If vgcreate returns messages about inability to open the vg group file, examine the minor number for the group file of the new volume group. The default value of maxvgs will return an error if the volume group minor number is 0x0a0000 or greater. nbuf This parameter is becoming outdated. Currently, this value is used mainly on 300/400 series platforms for configuring buffer cache. It is used in conjunction with bufpages--one nbuf for every two bufpages. If used on a 700 or 800 series machine, there will typically be an error in /etc/dmesg or in the syslog indicating that the number of nbufs were adjusted. Use of this parameter in place of bufpages, dbc_max_pct or dbc_min_pct is not advised for 700/800 series machines using HP-UX 9.0 or higher. Continued use may result in an error in the future should nbuf be removed completely from the kernel variable list. It is strongly advised this variable remain at 0. ncallout Maximum number of timeouts that can be scheduled by the kernel at any one time. The higher the number of processes and the higher the probability of multiple timeouts per process, the higher this value should be configured. Default is a formula (16+NPROC). netmemmax IP packet refragmentation assembly memory. A -1 value imposes no limit other than physical memory, while 0 will impose a limit of 10%. Values larger than 0 will specify amount of physical memory possibly rounded to the nearest page boundary. This memory is not reserved, only allocated as needed. Adjustments to this variable is a trade-off between user memory and kernel network memory. Some experimentation may be needed to find optimal values. nfile Number of open files for all processes running on the system. Though each entry is relatively small, there is some kernel overhead in managing this table. Additionally, each time a file is opened, it will consume an entry in nfile even if the file is already opened by another process. When nfile entries are exhausted, a console and/or syslog error message will appear specifically indicating "File table full". nflocks Number of file locks system wide. Each lock will get a new entry, similar to nfile. The cost in memory is rather small as well meaning little memory is used for each nflock entry. ninode This variable is notoriously oversized and can impose a heavy toll on the processor (especially machines with multiple CPUs). There is no active accounting of this table, so actual consumption is difficult to monitor. The best rule is not to increase it unless console/syslog messages are received specifically stipulating "Inode table is full", otherwise the table will look almost or completely full some time after boot. Unlike nfile, each time a file is opened it will consume only one entry in ninode. Often, there is no direct correlation between nfile and ninode. In addition, excessive values can actually cause a network timeout condition for High Availability Cluster, most often at the start of a backup routine. Few systems truly need an excess of 5,000 entries. When this variable is large, the initial wait time to hash an entry is quite short so that file opens can occur quickly at first. Since there is no active accounting, the only method of determining what is in this table is a serial search, which results in very expensive processing time. When the processor 'walks' this table, little other activity is performed. It is advised to keep this table rather small and perform increases only if inode table full messages are received. At that point, we recommend incremental increases of 10-20%. DNLC This parameter is not directly tunable but operates similar to ninode. It is the Directory Name Lookup Cache and is used for directory names instead of files. This is one of the parameters affected by maxusers. If kernel formulas are defeated, this variable typically assumes the value of ninode. Consequences are similar to ninode when very large values are set. The easiest method to check this variable is with glance -t and then examine the second page. It will contain both ninode and DNLC. There is no ability to examine this value with sar. Also, long directory names (greater than 14 characters) are not kept in this table and must be fully translated each time the directory is referenced. no_lvm_disks This variable informs the kernel to check for LVM disks. When it is set to 1, there be no checking at all. nproc This is another variable affected by indiscriminate setting of maxusers/maxuprc. It pertains to the number of processes system-wide. It is most commonly referenced when a ps -ef is run or when Glance/GPM and similar commands are initiated. The value should usually be 10-20% greater than the maximum number of processes observed to allow for unanticipated process growth. shmmax This is the largest value of each shared memory segment size in bytes. In most instances the maximum value is 1 GB. Installation of PHKL_8327, or a later replacement, will allow the cumulative total of all shared segments system-wide, to attain a maximum value of 2.75 GB while each segment remains limited to 1GB. swapmem_on This value enables memory for process deactivation/reactivation. It is most commonly seen under the swapinfo command and listed as memory. Though the default priority for pseudo-swap is 12, memory is initially used for deactivated processes. The main result is that I/O is reduced since deactivated processes are not necessarily migrated to disk swap areas or filesystems. Should memory pressure increase such that more memory pages are needed, deactivated processes will then be migrated to swap areas. It is not detrimental to observe the swap area being used with swapinfo -atm. Memory pressure is observed with the vmstat command and also verified when swapinfo shows reductions in the device reserve row with corresponding increases in the device PCT USED column. timeslice This value pertains to the number of clock ticks each process is able to consume prior to priority degradation and temporary loss of the processor. Typically, alteration of this parameter is a tradeoff. In most instances, modifications are not recommended or necessary. [Search Screen][Search Results][Search History][Document Display] [HP Electronic Support Center] (c) Copyright 1996-1998 Hewlett-Packard Company. Terms and Conditions/Software License Terms.