AIX性能分析命令

  • 格式:docx
  • 大小:218.54 KB
  • 文档页数:11

AIX性能分析命令一CPU性能分析1 lparstatThe lparstat command has been introduced for showing logical partition (LPAR) related information and statistics. The lparstat command resides in /usr/bin and is part of the bos.acct package, which is installable from the AIX base installation media.Syntaxlparstat { [ -i | -H | [ -h ] [ Interval [ Count ] ] }Flags-i Lists detailed information on LPAR configuration-H Provides detailed information about Hypervisor statistics-h Adds summarized Hypervisor statistics to the defaultoutputParametersInterval specifies the amount of time in seconds between eachreportCount specifies the number of reports generated2 mpstatThe mpstat command is the new command which collects and displays detailed output on performance statistics for all logical CPUs in the system. The mpstat command resides in /usr/bin and is part of the bos.acct fileset, which is installable from the AIX base installation media.Syntaxmpstat [ { -d | -i | -s | -a } ] [ -w ] [ interval [ count ] ]flags-a Displays all statistics report in wide output mode-d Displays detailed affinity and migration statistics for AIXthreads and dispatching statistics for logical processors inwide output mode-i Displays detailed interrupt statistics in wide output mode-s Displays SMT utilization report if SMT is enabled-w Turn on wide output modeParametersInterval specifies the amount of time in seconds between eachreportCount specifies the number of reports generated3 topasThe topas command is used to display statistics about the activity on the local system. The topas command reports the various kinds of statistics, such as CPU utilization, CPU events and queues, process lists, memory and paging statistics, disk and network performance, and NFS statistics. The topas command resides in /usr/bin and is part of the bos.perf.tools fileset, which is installable from the AIX base installation media.Syntaxtopas [ -d number_of_monitored_hot_disks ] [ -h ] [ -imonitoring_interval_in_seconds ] [ -nnumber_of_monitored_hot_network_interfaces ] [ -pnumber_of_monitored_hot_processes ] [ -wnumber_of_monitored_hot_WLM classes ] [ -cnumber_of_monitored_hot_CPUs ][ -Uusername_owned_processes ] [ -L |-P | -W ] [ -m]flags-i Specifies the monitoring interval in seconds. The default is twoseconds.-L Displays the logical partition display.Default outputStarting with AIX 5L Version 5.3, if the topas command runs on a shared partition, following two new values are reported for the CPU utilization. If the topas command runs on a dedicated partition, these values are not displayed. Physc Number of physical processors granted to the partition%Entc Percentage of Entitled Capacity granted to the partition4 sarThe sar (System Activity Report) command is used to collect statistics report about CPU, I/O, and other system activities. The sar command shows statistics in two ways, show real time data or show previously data. The sar command resides in /usr/sbin and is part of the bos.acct fileset, which is installable from the AIX base installation media.syntax/usr/sbin/sar [ { -A | [ -a ] [ -b ] [ -c ] [ -d ][ -k ] [ -m ] [ -q ] [ -r ] [ -u ] [ -v ] [ -w ] [ -y ] } ] [ -P ProcessorIdentifier, ... | ALL ] [ -ehh [ :mm [ :ss ] ] ] [ -X File ] [ -f File ] [ -i Seconds ] [ -o File ] [ -s hh [ :mm [ :ss ] ] ] [ Interval [ Number ] ]flags-P ProcessorIdentifier, ... | ALLReports per-processor statistics for the specifiedprocessor or processors. Specifying the “ALL” keywordreports statistics for each individual processor, andglobally for all processors.-o File Saves the statistics data in the file in binary form. Eachstatistics data are in a separate record and each recordcontains a tag identifying the time of the reading. You canextract records from this file using the sar command with-f flag.-f File Extracts records from the specified File (created by -o Fileflag).5 vmstatThe vmstat command reports statistics about kernel threads, virtual memory, disks, traps and CPU activity.Command Syntaxvmstat [ -f ] [ -i ] [ -s ] [ -I ] [ -t ] [ -v ] [ PhysicalVolume ... ] [ Interval [ Count ] ] ParametersInterval Specifies the amount of time in seconds between eachreportCount Specifies the number of reports generatedExamplesBeginning with AIX 5L Version 5.3, the vmstat command reports the number of physical processors consumed (pc), and the percentage of entitlement consumed (ec). These new metrics will be displayed only when the partition is running as a shared processor partition or with simultaneous multi-threading (SMT) enabled. If the partition is running as a dedicated processor partition and with simultaneous multi-threading (SMT) disabled, these new metrics will not be displayed. Example 4-17 on page 209 shows a sample of the vmstat command without flag on shared-partition. The first report contains statistics for the time since system startup. Subsequent reports contain statistics collected during the interval since the previous report.Following statistics information is he columns which related to CPU within the vmstat command output.kthr Kernel thread state changes per second over the sampling intervalr The number of kernel threads placed in run queueb The number of kernel threads placed in wait queue (awaitingresource or input/output)faults Trap and interrupt rate averages per second over the samplingintervalin The number of device interruptssy The number of system callscs The number of kernel thread context switchescpu Breakdown of percentage usage of CPU timeus The percentage of user timesy The percentage of system timeid The percentage of CPU idle timewa The percentage of CPU idle time during which the system hadoutstanding disk or NFS I/O requestspc The number of physical processors consumed. Displayed only ifthe partition is running with shared processorec The percentage of entitled capacity consumed. Displayed only ifthe partition is running with shared processor6 psThe ps command shows current status of processes. With regard to CPU, this command shows how much CPU resource a process is using, and whether processes are being penalized by the system. The ps command resides in/usr/bin and is part of the bos.rte.control fileset, which is installed by default from the AIX base installation media.SyntaxX/Open Standardsps [ -A ] [ -M ] [ -N ] [ -a ] [ -d ] [ -e ] [ -f ] [ -k ] [ -l ] [ -F format] [ -o Format ] [ -c Clist ] [ -G Glist ] [ -g Glist ] [ -m ] [ -n NameList ] [ -p Plist ] [ -t Tlist ] [ -U Ulist ] [ -u Ulist ] [ -T pid ] [ -L pidlist ] [ -X ]Berkeley Standardsps [ a ] [ c ] [ e ] [ ew ] [ eww ] [ g ] [ n ] [ U ] [ w ] [ x ] [ l | s | u | v ] [ t Tty ] [ ProcessNumber ] [ -X ]Flags-e Writes information to standard output about all processes,except kernel processes.-f Generates a full listing.-k Lists kernel processes.-o Format Displays information in the format specified by the Formatvariable. Multiple field specifiers can be specified for theFormat variable. For more information of field name, referto ps command reference.-L pidlist Generates a list of descendants of each and everyprocess ID that has been passed to it in the pidlistvariable. The pidlist variable is a list of comma-separatedprocess IDs. The list of descendants from all of the givenpid is printed in the order in which they appear in theprocess table.-M Lists all 64 bit processes.-T pid Displays the process hierarchy rooted at a given pid in atree format using ASCII art. This flag can be used incombination with the -f, -F, -o, and -l flags.-U Ulist Displays only information about processes with the userID numbers or login names specified for the Ulist variable.This flag is equivalent to the -u Ulist flag.a Displays information about all processes with terminals(ordinarily only the user's own processes are displayed).二CPU参数调整1 smtctlThe smtctl command controls the enabling and disabling of processor simultaneous multi-threading mode.This command is provided for privileged users and applications to control utilization of processors with simultaneous multi-threading support. The simultaneous multi-threading mode allows processors to have thread level parallelism at the instruction level. This mode can be enabled or disabled for all processors either immediately or on subsequent boots of the system. This command controls the simultaneous multi-threading options.Syntaxsmtctl [ -m off | on [ -w boot | now ]]Flags-m off Sets the simultaneous multi-threading mode to disabled.-m on Sets the simultaneous multi-threading mode to enabled.-w boot Makes the simultaneous multi-threading mode changeeffective on next and subsequent reboots.-w now Makes the simultaneous multi-threading mode changeimmediately but will not persist across reboot.2 niceThe nice command enables a user to adjust the dispatching priority of a command. Non-root authorized users can only degrade the priority of their own commands. A user with root authority can improve the priority of a command as well. A process, by default, has a nice value of 20. The renice command is used to change the nice value of one or more processes that are running on a system. The nice commands reside in /usr/bin and are part of the bos.rte.control fileset, which is installed by default from the AIX base installation media.syntaxnice [ -Increment| -n Increment ] Command [ Argument ... ]Flags-Increment Moves a command’s priority up or down. You can specifya positive or negative number. Positive increment valuesdegrade priority, and negative increment values improvepriority. Only users with root authority can specify anegative increment. If you specify an increment value thatwould cause the nice value to exceed the range of 0 to 39,the nice value is set to the value of the limit that wasexceeded.ParametersCommand This is the actual command that will run with the modifiednice value.3reniceThe renice command is used to change the nice value of one or more processes that are running on a system. The renice command can also change the nice values of a specific process group.The renice command resides in /usr/sbin/renice, is linked from /usr/bin/renice, and is part of the bos.adt.prof fileset, which is installable from the AIX base installation media.syntaxrenice [ -n Increment ] [ -g | -p | -u ] ID ...Flags-g Interprets all IDs as unsigned decimal integer processgroup IDs.-n Increment Specifies the number to add to the nice value of theprocess. The value of Increment can only be a decimalinteger from -20 to 20. Positive increment values degradepriority. Negative increment values require appropriateprivileges and improve priority.-p Interprets all IDs as unsigned integer process IDs. The -pflag is the default if you specify no other flags.-u Interprets all IDs as user name or numerical user IDs.ParametersID Where the -p option is used or any other flag is notspecified, this will be the value of the processidentification number (PID). In the case where the -g flagis used, the value of ID will be the process groupidentification number (PGID). In the case where the -uflag is used, this value denotes the user identificationnumber (UID).三内存性能分析_ Memory monitoring– The ps command– The sar command– The svmon command– The topas monitoring tool– The vmstat command_ Memory tuning– The vmo command1 psThe ps (Process Status) command shows the current status of active processes. It is located /usr/bin, installed by default from the AIX base installation media, and is part of the mands fileset.SyntaxUsage: ps [-AMN ae d f k l m] [-n namelist] [-F Format] [-o specifier[=header],...][-p proclist][-G|-g grouplist] [-t termlist] [-U|-u userlist][-c classlist] [ -T pid] [ -L pidlist ]Usage: ps [a ceglns uv w x U] [t tty] [processnumber]Useful combinations of the ps command for memory statistics_ ps aux_ ps v_ ps -ealfUsing the ps commandThe u and v flags report the following statistics_ %MEM, which is the percentage of real memory a process is using._ RSS, the amount of real memory size of the process (in 1KB units).The u flag also reports the SZ statistic, which represents the size of the core image of the process (in 1KB units).2 svmonThe svmon command is an analysis tool for virtual memory.It captures the current state of memory, including real, virtual and paging space memory. The svmon command invokes the svmon_back command. Both are located in /usr/lib/perf, and both part of the perfagent.tools fileset.Syntaxsvmon [-G [-i Intvl [NumIntvl] ][-z] ]svmon [-P [pid1...pidn] [-r] [-u|-p|-g|-v] [-ns] [-wfc] [-q] [-t Count] [ -iIntvl [NumIntvl] ] [-l] [-j] [-z] [-m] ]svmon [-S [sid1...sidn] [-r] [-u|-p|-g|-v] [-ns] [-wfc] [-q] [-t Count] [ -iIntvl [NumIntvl] ] [-l] [-j] [-z] [-m] ]svmon [-D sid1...sidn [-b] [-q] [ -i Intvl [NumIntvl] ][-z]]svmon [-F [fr1...frn] [-q] [-i Intvl [NumIntvl] ][-z] ]svmon [-C cmd1...cmdn [-r] [-u|-p|-g|-v] [-ns] [-wfc] [-q] [-t Count] [ -iIntvl [NumIntvl] ] [-d] [-l] [-j] [-z] [-m] ]svmon [-U [lognm1...lognmn] [-r] [-u|-p|-g|-v] [-ns] [-wfc] [-t Count] [ -iIntvl [NumIntvl] ] [-d] [-l] [-j] [-z] [-m] ]svmon [-W [class1...classn] [-e] [-r] [-u|-p|-g|-v] [-ns] [-wfc] [-q] [-tCount] [ -i Intvl [NumIntvl] ] [-l] [-j] [-z] [-m] ]svmon [-T [tier1...tiern] [-a superclass] [-x] [-e] [-r] [-u|-p|-g|-v] [-ns][-wfc] [-q] [-t Count] [ -i Intvl [NumIntvl] ] [-l] [-z] [-m] ]If no option is given, svmon -G is the default.Useful combinations of the svmon command_ svmon or svmon -G_ svmon -P_ svmon -C_ svmon -i4 vmoThe vmo command is a run time tool used to tune the VMM settings. It is located in /usr/sbin, and is installable from the base AIX Installation media. All the settings set by the vmo command are also saved in /etc/tunables.Syntaxv mo -h [tunable] | {-L [tunable]} | {-x [tunable]}vmo [-p|-r] (-a | {-o tunable})vmo [-p|-r] (-D | ({-d tunable} {-o tunable=value}))Useful combinations of the vmo command_ vmo -a_ vmo -h tunable_ vmo -L tunable_ vmo -r -o tunable=value四磁盘IO性能调整。