Chapter 22 Performance & Tuning HP-UX Handbook Revision 13.
Chapter 22 Performance & Tuning October 29, 2013 TERMS OF USE AND LEGAL RESTRICTIONS FOR THE HP-UX RECOVERY HANDBOOK ATTENTION: PLEASE READ THESE TERMS CAREFULLY BEFORE USING THE HP-UX HANDBOOK. USING THESE MATERIALS INDICATES THAT YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THESE TERMS, DO NOT USE THE HP-UX HANDBOOK. THE HP-UX HANDBOOK HAS BEEN COMPILED FROM THE NOTES OF HP ENGINEERS AND CONTAINS HP CONFIDENTIAL INFORMATION.
Chapter 22 Performance & Tuning October 29, 2013 TABLE OF CONTENTS HP-UX Performance and Tuning ______________________________________________________ 4 Memory _________________________________________________________________________ 5 How Memory is Mapped in HP –UX __________________________________________________________ 6 Tools for monitoring memory allocation ______________________________________________________9 Disk I/O _________________________________________________________________________ 12
Chapter 22 Performance & Tuning October 29, 2013 HP-UX Performance and Tuning Serious performance issues are complex ,often involving the Operating System, and the physical resources which may not be HP components. In depth performance analysis is considered to be a Consulting engagement best addressed by the APS Customer Performance Team (CPT) which provides Performance Solutions and Consulting for complex computing environments using HP-UX and Linux.
Chapter 22 Performance & Tuning October 29, 2013 configuration under problem conditions. Samples should be of sufficient length and granularity to allow a statistically significant sample. As problems root cause may not be clear, it is prudent to capture a wide scope of data to analyze for potential resource contention . Memory issues : swapinfo -tam vmstat -n 60 20 ps -elf |sort -rnk 10 sar -b 5 120 CPU sar -Muq 5 120 ps -elf |sort -rnk 8 System Tables sar -v 10 60 OS configuration : kctune -v ( if 11.
Chapter 22 Performance & Tuning October 29, 2013 How Memory is Mapped in HP –UX Kernel Address Space Layout In kernel mode the process context space registers ( sr4-sr7) need to be set to kernel context. This allows the kernel to access its virtual address space using short pointers. Quadrant 1 Unlike user processes, all the kernel text and data reside in Quadrant 1. Quadrant 2 does not contain a private area used for data.
Chapter 22 Performance & Tuning October 29, 2013 NOTE: Memory is allocated on sequential basis; it must be allocated in contiguous segments. Due to this protocol, while there may be enough total memory free for a process , if there isn’t a large enough contiguous segment , the call to memory will fail. Whether in kernel or user mode, the system will allocate the first free segment that satisfies the request.
Chapter 22 Performance & Tuning October 29, 2013 Keep in mind that many modern disk arrays buffer their writes with onboard memory, also many databases use lockable memory to buffer within the System Global Area or SGA. Some databases do not use an SGA and may benefit from a large cache. Note: Buffers remain in the cache even after a file is closed , as they could be used again in the future. Some database vendors recommend locking the cache down , i.e.
Chapter 22 Performance & Tuning October 29, 2013 first area to check.
Chapter 22 Performance & Tuning October 29, 2013 If there is an insufficient amount of available memory to fork you will receive an error : cannot fork, not enough virtual memory. If this error is received , you will need to allocate more device swap. This should be configured on a disk with no other swap partitions, and ideally of the same size and priority of existing swap logical volumes to enable interleaving.
Chapter 22 Performance & Tuning October 29, 2013 The column headings and the meaning of each column are: procs Information about numbers of processes in various states. r -In run queue b -Blocked for resources (I/O, paging, etc.) w -Runnable or short sleeper (< 20 secs) but swapped memory Information about the usage of virtual and real memory. Virtual pages are considered active if they belong to processes that are running or have run in the last 20 seconds.
Chapter 22 Performance & Tuning October 29, 2013 Disk I/O Disk I/O efficiency is effected by a number of factors: The amount of reads and writes pending in the run queue The cumulative load on the controller, and it’s maximum capacity The amount of buffer/file cache available The size of I/O’s Mount options Patch level Memory contention CPU resources To determine Disk I/O load , the system activity reporter is a good starting point, to obtain a statistically significant sample it is prud
Chapter 22 Performance & Tuning October 29, 2013 avserv Average time (in milliseconds) to service each transfer request (includes seek, rotational latency, and data transfer times) for the device. When average wait (avwait) is greater than average service time (avserv) it indicates the disk can't keep up with the load during that sample. When the average queue length exceeds the norm of 0.50 it is an indication of jobs stacking up. When it reaches 1.0 the run queue is at saturation.
Chapter 22 Performance & Tuning October 29, 2013 # cat /etc/fstab to determine the file system type associated with the lvol/ mountpoint # bdf to see if this volumes file systems are reaching capacity full ( > 85%) If installed Glance can be used to identify I/O by file system How to improve disk I/O ? 1. 2. 3. 4. Reduce the volume of data on the disk path to till the run queue is less than 1.0 Stripe the data across disks to improve I/O speed and decrease path overload.
Chapter 22 Performance & Tuning October 29, 2013 on. The write can have physically taken place or could be in the buffer cache but in either case, acknowledgement has been sent. In the case of async, no waiting. To implement asynchronous I/O on HP-UX for raw logical volumes: * set the async_disk driver (Asynchronous Disk Pseudo Driver)to IN in the HP-UX Kernel, this will require generating a new kernel and rebooting .
Chapter 22 Performance & Tuning October 29, 2013 round_robin: Appropriate when all the paths to the device have similar I/O turnaround characteristics. least_cmd_load: The LUN path with the least number of active I/O requests is selected to execute the next I/O. This policy is appropriate when the paths to the LUN exhibit asymmetric latency characteristics. The load is distributed to optimize the bandwidth on each LUN path.
Chapter 22 Performance & Tuning October 29, 2013 kernel checks each processor to determine whether it is running a thread or process or is idle. If it is idle, it checks to see if there is any outstanding IO for that processor. If there is, the time gets counted as %wio, if not the time is counted as idle time. If the cpu is busy, the time is attributed either to user cpu or system cpu based on the process. There is no check on I/O at all.
Chapter 22 Performance & Tuning October 29, 2013 POSIX real-time schedulers: SCHED_FIFO SCHED_RR SCHED_RR2 HP-UX real-time scheduler: SCHED_RTPRIO HP-UX timeshare scheduler: SCHED_HPUX SCHED_NOAGE The default priority range of each scheduler is as follows: scheduler highest priority lowest priority SCHED_FIFO 31 0 SCHED_RR 31 0 SCHED_RR2 31 0 SCHED_RTPRIO 0 127 SCHED_NOAGE 178 255 SCHED_HPUX N/A N/A The most commonly used alternate scheduling policies are SCHED_NOAGE , this allows pr
Chapter 22 Performance & Tuning October 29, 2013 RETURN VALUE rtsched returns exit status: 0 if command is successfully scheduled or if pid's real-time priority is successfully changed; 1 if command is not executable, pid does not exist, or priority is not within the priority range for the corresponding scheduler; 2 if command (pid) lacks real-time capability, or the invoker's effective user ID is not a user who has appropriate privileges, or the real or effective user or the real or effective user ID do