Computer system performance optimization is a comprehensive topic that relates to an analysis of system resources and applications and network environments. This article will detect how the RS / 6000 system performance is found to find a brief introduction to a resource bottleneck that causes performance reduction (Note: This article does not involve resource bottlenecks caused by applications or network factors). The so-called system resources include memory, CPU, and input / output devices. By using the following command, there is a clear understanding of the load of RS / 6000 system resources: VMSTAT SVMON PS TPROF IOSTAT NETPMON FILEMON Note: Use the command vmstat, iostat, and SAR to install the package bos.acct Using the Command PS to be installed Package Bos.rte.Control Use the commands TPROF, SVMON, NetPMON, and Filemon, you need to install the package perfagent.tools We can find and install the above packages from the first CD of the AIX system. This article will also refer to the command VMTune and SchedTune. You need to install the package. BOS.ADT.SAMPLES Memory Bottleneck This section describes the following commands to detect the memory usage of the system, and clearly understand the use of system memory and Assignment, confirm that the memory resource has a bottleneck. 1. The VMSTAT VMSTAT command is used to count and display the core thread, virtual memory, hard disk, interrupt and CPU usage. Run command # vmstat 2 10 Note: When PI and PO are continuous non-zero values, the system running speed will be reduced. PI Tumble from page space (4KB / PAGE) from page space per second; Po-Paging Space-Paging Space (PAGING SPACE) number of pages per second; When you can use the number of pages available, some memory pages will be replaced by memory, stored in the system page space (Paging Space), and then transfer to memory when used. Since the speed of the page in the access page space is much smaller than the access speed of the memory page, the frequent change will reduce the speed of the system. Note: When the value of FR and SR increases, the Sample Ming memory load increases. FR is a memory page that is released to the memory empty SAMPLE or assigned to a process; SR is the number of pages you need to check if the number of idle pages from the FR; the FR / SR ratio is 1: 4Sample Ming Each release one memory page needs to check four Page. When PO * SYS> FR (SYS is a system parameter, you can use the command SchedTune to view), the system itself thinks the edge of the crash. SYS has a default value on 128MB or more memory system. SAMPLE is disabled from memory loading control, otherwise the default is 6. System Crash SAMPLE Ming Ming This time the system uses a large amount of time for memory switching / replacement without sufficient time processing or normal operation. At this time some process will be temporarily suspended, and the system is running significantly. 2. The SVMON SVMON command statistics and displays the usage of virtual memory. Run the command # svmon -Pau 10 | More output as superuser (root): PID command inuse PIN PGSPACE 13794 DTWM 1603 1 449 PID: 13794 Command: DTWM This command shows the top ten processes in memory, and A detailed SAMPLE is given for each process (describing the description information for one of the processes for one of the processes). In column SAMPLE in each process, find the corresponding row of Type to "Work" and Description as "Private", check the number of pages displayed in PgSpace (4096 bytes per page), which is this paragraph ( Segment) The number of work pages occupied in the virtual memory space, that is, the number of pages in the page space occupied.
If the PGSpace value continues to grow, the system may have memory leaks. An issue of memory leakage occurs when the application does not properly release the memory. The above command format and output result apply to the version before AIX4.3.3. On the AIX4.3.3 system, you can run the SVMON -PU 10 | More its output format is basically the same as the upper stroke, but the field "pgspace" replaced with "PGSP". 3. The PS PS command displays the currently running process status information. Run the following command #ps gv | Head -n 1; PS GV | EGREP -V "RSS" | Sort 6b -7 -r size page space allocated Type is "Work", Description is "private "The memory segment size (k byte). This value can also be displayed by command SVMON. The memory segment (physical memory) size (K byte) of the RSS process (K byte), including Type "Work" and Description for "private" memory segment for "PERS" and Description as "Code" . This value can be displayed over the command SVMON. The TRS process is a memory segment of the resident memory, including the memory segment of Type "PERS" and Description as "Code". This value can be displayed by command SVMON. % MEM RSS accounts for the percentage of physical memory (%). As mentioned above, using the PS command can also view the memory allocation of each process. The CPU bottle neck will use the command VMSTAT, TPROF, and PS to check if there is a brief introduction of the CPU bottleneck. 1. VMSTAT uses the command # vmstat 1 10 Note: The system running speed will be reduced when the run queue has a process. ID CPU idle time or percentage of no I / O waiting time; WA CPU I / O waits time percentage; R running the number of threads in the queue; if the ID and WA are in the value of near 0, Sample CPU At this time It is busy. Let's take a look at the field R (the number of threads in the queue). The more threads waiting in the run queue, the greater the impact of system performance. 2. The TPROF TPROF command is used to count the CPU usage of each process. Run the following command as a superuser root, you can find the CPU time occupied by the process: # TPROF -X Sleep 30 This command runs for 30 seconds, and creates a file called _prof.all in the current directory. Within 30 seconds, the number of CPUs was scheduled for approximately 3000 times. __prof.all Field Total is the number of CPUs scheduled to this process. If the value of the Total field corresponding to the process is 1500, SAMPLE shows that the process takes up 1,500 CPU schedules, or is understood to use half of the CPU time. The output of TPROF exactly shows which process is using the CPU time. __Prof.all file example: 3. Netpmon netpmon command is used to monitor the usage of I / 0 and CPUs related to the network. Run the following command as root, you can find the CPU time used by the process, and the CPU time used in which the code related to the network is used: # Netpmon -o /tmp/netpmon.out -o cpu -v; Sleep 30; trcstop The command runs for 30 seconds and generates file NetPMon.out in the / TMP directory.
Where the field CPU TIME uses the CPU time total value, CPU% corresponds to its percentage, Network CPU% is the CPU percentage occupied by the code related to the network. As shown below: Input Output (I / O) Bottle Neck 1. The iostat iostat command is used to statistically the use of the CPU and the TTY device, the hard disk, and the I / 0 of the CD-ROM. Run command: iostat 5 10 will display 10 statistics, the following is one of the data: where% iowait is waiting for the local I / O, the percentage of CPU idle time% IDLE does not wait for the local I / O CPU idle time percentage The CPU's process is required but at least one process is waiting for I / O, the CPU timeout is iowait. If the percentage of iowait time is high, SAMPLE indicates that the disk input and output (I / O) is the main reason why the system is running slowly. % TM_ACT hard drive busy percentage Note: The value of TM_ACT is very high, and the Sample Ming hard disk exists I / O bottleneck. When% TM_ACT (hard disk busy time) is high, it may feel that the system runs in slow down. The system performance will be affected when the% TM_ACT value of a hard disk on a system is 60% or higher. Two suggestions: 1. Observe the busy and idle hard drive, move the data from a busy disk to a relatively idle disk, which reduces the I / O bottleneck caused to some extent. 2. Check the frequency of the memory switching in accordance with the method described in the "Memory Bottleneck" above. A large amount of change will increase the I / O load. 2. The Filemon Filemon Command is used to see which file / logical volumes / hard drives are busy. Run the following command when system I / O is in a busy state: # filemon -u -o all -o /tmp/fmon.out; Sleep 30; file / TMP / FMON for recording tracking information will be generated after 30 seconds. OUT. From this file, you can find: 1. The most busy virtual memory segment (segment), logical volume, and physical volume; 2. Confirm that the hard disk I / O is due to application operations Still frequent change operation; 3. The most active file or logical volume, if they store on busy physical volumes, consider moving data to relatively idle hard drives, which helps improve system performance. The most busy segment of the newspaper SAMPLE shows the file system and i node corresponding to the busiest file. The INODE (inode) of the Mount Point and files of the file system can be used with the command nCheck to find the corresponding file. This newspaper SAMPLE can be used to determine whether the I / O operation is for file system, JFS log or system page space. By checking the value of the field "Reads" and "Read Sequences", it can be judged that the operation is sequentially read or randomly read. When "Read Sequences" is close to "Reads", access to this file is mostly a random read mode. (Appendix A. Output Example for Command Filemon) Conclusion There is a very useful tool here. It is worth mentioning. package. These include XMPERF based on X-Windows-based graphical interface diagnostic tools for real-time detection system resources. (Note: This package is not available in the AIX operating system CD.) We discussed the resource bottleneck problem of the RS / 6000 system in the text, and the specific usage of the system command involved can find the AIX online command manual.
In addition, the performance of a system has a close relationship with network factors and applications, and there are still many methods and tools for the factors, and don't introduce here. I hope that everyone will gradually explore in actual work, becoming the RS / 6000 system performance analysis expert Appendix A (Filemon Output File Example) ------------------------- ----------------
Thu Aug 19 11:30:49 1999 System: AIX TEXMEX NODE: 4 Machine: 000691854C00 0.369 SECS in Measured Interval CPU Utilization: 9.0% Most Active Files ---------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- --------- #MBS #opns #rds #wrs file volume: inode ----------------------------- ------------------------------------------------ 0.1 1 14 0 Smit.log / DEV / HD4: 858 0.0 1 0 13 NULL 0.0 2 4 0 ksh.cat / dev / hd2: 16872 0.0 1 2 0 cmdtrace.cat / dev / hd2: 16739 Most Active segments ----- -------------------------------------------------- ----------------------- #MBS # rpgs #wpgs segid segtype volume: inode -------------------------------------------------------------------------------------------------- -------------------------------------------------- ------------ 0.1 13 0 5E93 ??? 0.0 2 0 22ed???
0.0 1 0 5C77 Persistent Most Active Logical Volumes ------------------------------------------------------------------------------------------------------------------- ------------------------------------- Util # rblk #wblk KB / S Volume Description --- -------------------------------------------------- ------------------------- 0.06 112 0 151.9 / DEV / HD4 / 0.04 16 0 21.7 / dev / hd2 / usr Most Active Physical Volumes - -------------------------------------------------- ------------------------- Util # rblk #wblk KB / S Volume Description -------------- -------------------------------------------------- -------------- 0.10 128 0 173.6 / dev / hdisk0 n / a ------------------------- -------------------------------------------------- --- Detailed File Stats ---------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------- File: /smit.log volume: / dev / hd4 (/) inode : 858 Opens: 1 Total Bytes Xfrd: 57344 Reads: 14 (0 Errs) Read Sizes (bytes): AVG 4096.0 Min 4096 MAX 4096 SDEV 0.0 Read Times (MSEC): AVG 1.709 min 0.002 Max 19.996 SDEV 5.092 File: / DEV / Nu Ll Opens: 1 Total Bytes xfrd: 50600 Writes: 13 (0 errs) Write Sizes (bytes): AVG 3892.3 min 1448 MAX 4096 SDEV 705.6 Write Times (msec): AVG 0.007 min 0.003 Max 0.022 SDEV 0.006 File: / usr / lib /nls/msg/en_us/ksh.cat volume: / dev / hd2 (/ usr) inode: 16872 Opens: 2 Total Bytes Xfrd: 16384 Reads: 4 (0 Errs) Read Sizes: AVG 4096.0 min 4096 max 4096 SDEV 0.0 Read Times (MSEC): AVG 0.042 Min 0.015 Max 0.070 Sdev 0.025 Lseeks: 10 file: /us/lib/nls/msg/EN_US/Cmdtrace.cat Volume: / dev / hd2 (/ usr) Inode: 16739 OPENS: 1 Total Bytes Xfrd: 8192 Reads: 2 (0 Errs) Read Sizes (bytes): AVG 4096.0 min 4096 MAX 4096 SDEV 0.0 Read Times (msec): AVG 0.062 min 0.049 Max 0.075 Sdev 0.013 Lseeks:
8 ------------------------------------------------- ---------------------------- Detailed VM Segment Stats (4096 byte pages) ------------ -------------------------------------------------- ---------------- Segment: 5E93 segtype: ??? segment flags: reads: 13 (0 Errs) Read Times (msec): AVG 1.979 min 0.957 max 5.970 SDEV 1.310 Read sequencees : 1 read seq. Lengths: AVG 13.0 min 13 Max 13 Sdev 0.0 segment: 22ed segtype: ???
segment flags: inode reads: 2 (0 errs) read times (msec): avg 8.102 min 7.786 max 8.418 sdev 0.316 read sequences: 2 read seq lengths:. avg 1.0 min 1 max 1 sdev 0.0 SEGMENT: 5c77 segtype: persistent segment flags : PERS Defer Reads: 1 (0 Errs) Read Times (MSEC): AVG 13.810 min 13.810 MAX 13.810 SDEV 0.000 Read Sequences: 1 Read Seq. Lengths: AVG 1.0 min 1 max 1 sdev 0.0 --------- -------------------------------------------------- ------------------- Detailed Logical Volume Stats (512 Byte Blocks) ---------------------- -------------------------------------------------- ----- Volume: / deV / hd4 Description: / Reads: 5 (0 ERRS) Read Sizes (BLKS): AVG 22.4 min 8 Max 40 Sdev 12.8 Read Times (MSEC): AVG 4.847 min 0.938 MAX 13.792 SDEV 4.819 Read Sequences: 3 Read Seq. Length 8 MAX 64 Sdev 22.9 Seeks: 3 (60.0%) Seek dist (Blks): Init 6344, AVG 40.0 min 8 Max 72 Sdev 32.0 Time to Next Req (MSEC): AVG 70.473 min 0.224 MAX 331.020 SDEV 130.364 THROUGHPUT: 151.9 K B / sec utilization: 0.06 Volume: / dev / hd2 Description: / usr reads: 2 (0 Errs) Read Sizes (BLKS): AVG 8.0 min 8 Max 8 SDEV 0.0 Read Times (MSEC): AVG 8.078 min 7.769 max 8.387 SDEV 0.309 Read Sequences: 2 Read Seq. Length 8 Max 8 Sdev 0.0 Seeks: 2 (100.0%) Seek Dist (Blks): Init 608672, AVG 16.0 min 16 Max 16 SDEV 0.0 Time To Next Req (MSEC): AVG 162.160 min 8.497 Max 315.823 SDEV 153.663 THROUGHPUT: 21.7 KB / SEC Utilization: 0.04 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------- Detailed Physical Volume Stats 512 Byte Blocks ---------------------------------------------- -------------------------------- Volume: / dev / hdisk0 Description: N / A Reads: 7 (0 ERRS) Read Sizes (BLKs):