[Linux] To view the performance of the command (top and glance) of the detailed __linux

Source: Internet
Author: User
Tags hp ux memory usage time 0 cpu usage

Liunx view the commands for performance (top and glance)

Top command for Linux

The top command is a commonly used performance analysis tool under Linux to display the resource consumption status of each process in real time, similar to the Task Manager of Windows. The following is a detailed description of how it is used.

During system maintenance, you may need to look at the CPU usage at any time, and analyze the system condition according to the corresponding information. In CentOS, you can view CPU usage through the top command. When you run the top command, the CPU usage status is displayed in full screen and in a conversational mode-with the command based on top, you can control how the display is displayed, and so on. The command to exit top is Q, let's look at the relevant commands below.

Linux View Performance Action Examples:

Enter top on the command line

You can start top

Top Full Screen Dialog mode can be divided into 3 parts: System Information Bar, command input bar, process list bar.

The first part--The top System Information Bar:

First line (top):

"00:11:04" is the current moment of the system;

"3:35" to the current operating time after the system is started;

"2 Users" is the user who is currently logged on to the system, or, more specifically, the number of terminals to which the user is logged on--the same user's connection to multiple terminals at the same time will be treated as multiple users connected to the system, and the number of users here will also show

Is the number of terminals;

"Load average" is the average of the current system load, followed by three values 1 minutes ago, 5 minutes ago, 15 minutes before the average process, you can generally think that the number of CPU, the CPU will be more laborious negative

Contains the processes contained in the current system;

Second line (Tasks):

"Total" is the current number of system processes;

"1 Running" is the number of processes currently running;

"Sleeping" is the number of processes currently in the waiting state;

"0 stoped" is the number of system processes stopped;

"0 Zombie" for the number of recovered processes;

Third line (Cpus):

The current utilization rate of CPU is indicated respectively.

Line Four (MEM):

Represents the total amount of memory, current usage, amount of idle memory, and the amount of RAM used in the buffer;

Line Five (Swap):

Represents a category with line fourth (MEM), but this reflects the usage of swap partitions (swap). Typically, swap partitions (swap) are used frequently, and are considered to be the result of insufficient physical memory.

Part Two--internal command prompt bar in the middle section:

Linux View performance Top run can control how the process is displayed through the top internal commands. The internal command follows the following table:

-linux View Performance Change screen update frequency

L-The representation of the first line top information on the first section is closed or opened

T-closes or opens the first part the second line of Tasks and third line Cpus information representation

M-to close or open the first section the representation of the four-line Mem and fifth-line Swap information

N-Arranges the list of processes in the order of the PID size (Part III)

P-Arranges the list of processes in the order of CPU usage (Part III)

M-Arranges the list of processes in the Order of Memory occupancy (Part III)

H-Show help

N-Sets the number of processes displayed in the process list

Q-Exit Top

S-

Linux Viewing performance changes screen update cycle

Part three--The process list bar in the bottom section:

The PID-Differentiated process list updates periodically according to the set of screens. Linux viewing performance controls how this is displayed through the top internal command.

?

The first 5 lines of statistics are as follows:

top-01:06:48 up 1:22, 1 user, load average:0.06, 0.60, 0.48

tasks:29 Total, 1 running, sleeping, 0 stopped, 0 zombie

Cpu (s): 0.3% us, 1.0% sy, 0.0% ni, 98.7% ID, 0.0% wa, 0.0% Hi, 0.0% si

mem:191272k Total, 173656k used, 17616k free, 22052k buffers

swap:192772k Total, 12k used, 192772k free, 123988k cached

The first line is the task queue information, with the execution result of the uptime command.

Its contents are as follows:

01:06:48 current time;

Up 1:22 system run time, format last: cent;

1 user number of users currently logged in;

Load average:0.06, 0.60, 0.48 system load, that is, the average length of the task queue. Three values are 1 minutes, 5 minutes, and 15 minutes ago to the current average.

The second is process information,

The contents are as follows:

Total process tasks:29;

1 running the number of processes running;

The number of sleeping sleep processes;

0 stopped the number of processes stopped;

0 Zombie Zombie Process number.

The third line is the CPU information

The contents are as follows:

0.3% US user space CPU percent;

1.0% sy kernel space occupies CPU percent;

0.0% NI User process space to change the priority of the process to occupy CPU percentage;

98.7% ID idle CPU percent;

The percentage of CPU time 0.0% WA waits for input and output;

0.0% hi; 0.0% si;

The last two acts of memory information.

The contents are as follows:

? Total physical memory of mem:191272k;

The total amount of physical memory used by 173656k used;

17616k free RAM total;

The amount of memory used as kernel cache by 22052k buffers;

Total Exchange area of swap:192772k;

Total number of swap areas used by the 72k used;

192700k free idle swap area total;

123988k cached buffer total Exchange area;

The content in memory is swapped out to the swap area and then swapped into memory, but the used swap area has not been overwritten, which is the size of the swap area where the content already exists in memory. When the corresponding memory is swapped out again, you do not have to write to the swap area again.

Process Area Information:

Pid?????? USER?? PR?? NI???? Virt?? Res??? Shr?? S??? %CPU???? %mem??? time+???? COMMAND

1379???? Root??? ???? 0????? 7976?? 2456?? 1980 S??? 0.7?????????? 1.3????????? 0:11.03?? Sshd

14704?? Root??? ???? 0????? 2128?? 980???? 796??? R??? 0.7?????????? 0.5???????? 0:02.72?? Top

1?????????? Root??? ???? 0????? 1992?? 632???? 544??? S??? 0.0?????????? 0.3????????? 0:00.90?? Init

2??????????? Root??? ??? ???? 0???????? 0????????? 0??????? S??? 0.0?????????? 0.0???????? 0:00.00?? ksoftirqd/0

3?????????? Root???? Rt?? 0????? 0???????? 0???????? 0??????? S??? 0.0?????????? 0.0????????? 0:00.00 watchdog/0

The detailed description is:

PID process ID;

User name of the owner of the user process;

PR priority level;

Ni,nice value. A negative value indicates a high priority, and a positive value indicates a low priority;

The total amount of virtual memory used by the virt process, in units Kb,virt=swap (in virtual memory used by the swap process, the size of the swapped out, in kilobytes) +res;

The amount of physical memory that is used by the RES process, which is not swapped out, in units Kb,res=code (the physical memory size of the code executable, in kilobytes) +data (the amount of physical memory (data segment + stack) consumed in parts other than the number executable code, in kilobytes);

SHR Shared memory size, unit KB;%CPU Last updated to current CPU time occupancy percentage; S process status (d=, r=, s= Sleep, t= tracking/stopping, z= zombie process);

The percentage of physical memory used by the%MEM process;

Total CPU time used by the time+ process, in units 1/100 seconds;

Command name/command line.

Display Item Settings:

Press the F key to enter the process information switch interface, select the corresponding letter set whether to show the item, the default before the * for display information.

Basic operations:

K for the killing process;. or help for seeking assistance; I for ignoring idle and zombie processes; Q is the exit program; R is the setting priority; s is used to set the interval between two refreshes.

Deep usage of glance

1, the installation of Glance Pak (glance Pak included in the MeasureWare tools to do performance analysis)
To determine if the glance Pak is installed: see/var/opt/perf/gkey and Mwakey two license files, it is recommended to back up these two files, you can avoid the reload glance cannot find the codeword can not install the situation appears, Install the trial version directly and then copy the two original files to be used as a formal version. In addition, reinstall Glance Pak, you need to stop the Midaemon process, note that the installation of glance and MeasureWare two packages, the need for a consistent version, otherwise the software coredump, with #perfstat–v Check Glanceplus and measureware version is consistent;

2 Modify the contents of the/var/opt/perf/parm file (define the application process name that requires collection of performance):
Application=application name (name of the application is casually defined)
File= process Name (available * wildcard characters)

For example:
application = Informix
File = Onstat

3, with #mwa status (all command files stored in/opt/perf/bin), view the MeasureWare state;

4, with #mwa start MeasureWare collect the process performance data collection services, view the resulting/var/opt/perf/datafiles/log* files, whether every 5-10 seconds update once, if you can be assured, and remind users to observe the log growth rate, Especially for some space-tense mainframe;

5, one or two weeks later performance data:
#mwa status
#mwa stop? (Stop MeasureWare Collection Service)

6. Upload Zamdata.txt script with the way of ASC of FTP
#cd/var/opt/perf/datafiles/
#sh zamscript.txt? (Collect all the performance data after MeasureWare start)
View the zamdata.csv generated under the current directory
Download the Zamdata.csv file with the FTP bin and then use the tool to generate the profiling report


Glance monitoring commands for use on HP UX?

??? Recently, because of the need to write reports to customers, so the glance,glance monitoring tool is a powerful and easy-to-use online monitoring tool in HP-UX system, it has two versions, one is GPM, graphics mode, the other is glance, text mode. It can be used on almost any terminal or workstation, with very little resource usage. Any version can provide a wealth of system performance information. The default Process list lists general information about system resources and active processes, and more details include: CPU, Memory, Disk IO, network, NFS,
???? System Calls, Swap, and system Table.
???? Syntax: glance [-j interval] [P [dest]] [-f dest] [-maxpages numpages]
???? [-command] [-nice Nicevalue] [-nosort] [-lock]
???? [-adviser_off] [-adviser_only] [-bootup]
???? [-iterations Count] [-syntax filename] [-all_trans]
???? [-all_instances] [-disks] [-kernel] [-nfs]
???? [-pids] [-no_fkeys]
???? Option Description:
???? -j interval Sets the time interval for screen refreshes, in seconds, by default of 5 seconds, and the range of values allowed: 1~32767
???? -P [dest] This option enables continuous printing, which is effective for printing at a very long screen refresh interval,
???? The output is directed to a default local printer, unless input device parameters are required. Once
???? Run start, you can terminate the operation with the P command
???? -F dest This option enables continuous printing, which is effective for printing at a very long screen refresh interval.
???? The output is directed to a given file. Once the operation starts, you can terminate the exercise with the P command
???? For
???? -maxpages NumPages when using the-P command, the-maxpages option can change the maximum number of pages printed, and the default is 200 pages
???? -command This option is used to set the process list to a different screen display, this key setting will show different
???? Information, detailed commands see the following-command option, only one command can be selected
???? -nice nicevalue This option allows you to adjust the priority level of the glance process, the default value is-10
???? -nosort This option is set, the screen does not have to sort the process to display, which can reduce the glance
???? CPU overhead of a process
???? -lock This option allows you to lock the glance into memory, which can greatly improve response time, but has
???? You may receive an error message: "Unable to allocate memory/swap spaces", and you must cancel this option to rerun
???? -adviser_off allows you to turn off the recommended mode of operation Glance
???? -adviser_only This option allows Glace to run on a terminal without screen, suggesting that the prompts will run and send the results to standard output. Suggested mode can be run in the background, you can redirect the results to a file, but you must use the-BOOTUP option in conjunction with the
???? -bootup and-adviser_only are used together and the recommended mode is turned on at startup
???? -iterations count This option can limit the number of intervals at glance run time, this option
???? And the-adviser_only option are used in conjunction with no terminal display. Glance after a given number of executions, the iteration is listed and exited
???? -syntax filename applies this option to enable custom recommendation files
???? -all_trans This option allows glance to list all registered tasks in the system. If not specified, glance only lists filtered items
???? -all_instances This option allows glance to display an example of all action records
???? -disks Monitoring Disk
???? -kernel Monitoring System kernel
???? -NFS Monitor NFS Usage
???? -pids Monitor specified process
???? The above four command option values are passed directly into the Midaemon (HP's Performance Monitor Interface daemon) and the Midaemon boot parameters are adjusted, and if Midaemon is already running, these option settings will not be ignored
???? -no_fkeys This option to mask the function keys displayed on the Operation screen.
???? List of-command options
????
???? Command Screen Displayed/description
???? A CPU by Processor
???? C CPU
???? D Disk
???? G Process List
???? I IO by File System
???? L Network by Interface
???? M Memory
???? N NFS by System
???? T System Tables
???? U IO by Disk
???? V IO by Logical Volume
???? W Swap Space
???? A Application List
???? B Global Waits
???? D DCE Global Activity
???? G Process Threads
???? H Alarm History
???? I Thread Resource
???? J Thread Wait
???? K DCE Process List
???? N NFS Global Activity
???? P PRM Group List
???? T Transaction Tracker
???? Y Global System Calls
???? Z Global Threads
???? ? Commands Menu
????
???? Glance keyboard commands at run time
???? S Select System/disk/application/trans/thread
???? s Select View Process
???? F Process open files
???? L Process System Call
???? M Process Memory
???? R Process Resources
???? W process Wait State
????
????
???? Screen Display control command
???? B next Page
???? F Previous Page
???? H Online Help
???? J Adjust Screen refresh interval
???? o Adjust Process thresholds
???? P Output Print terminated
???? E/Q Exit Glance
???? R Refresh the current screen
???? Y Reset the process's nice value
???? Z to zero statistic information
???? > Show Next screen
???? < Show previous screen
???? ! Call a shell
????
???? Screen Display description
???? Using glance in text mode, the following screen appears when you start:
???? ProcList CPU Rpt Mem Rpt Disk Rpt nextkeys slctproc help Exit
???? b3692a glanceplus c.03.71.00 14:08:08 hpdemo01 9000/800 current AVG Hig
???? -------------------------------------------
???? CPU Util | 0% 0% 1
???? Disk Util F | 1% 1% 2
???? Mem Util S Suub B | 22% 22% 22
???? Swap Util U | 7% 7% 7
???? --------------------------------------------------
???? PROCESS LIST users= 2
???? User CPU Util cum Disk Thd
???? Process Name PID PPID Pri name (400% max) CPU IO Rate RSS Cnt
???? -------------------------------------------
???? VXFSD 0 138 root 0.0/0.0 0.0 3.3/3.1 1.8mb 22
????
????
???? The first line displays information about the glance itself and the system that runs it. The following shows the CPU, disk,
???? Information about the utilization of memory and swap space. The following are described separately:
???? A CPU utilization
???? The rows that display CPU utilization begin with a bar chart with different shades. It is divided into several parts to show CPU utilization for different purposes. Each part of the bar chart starts with a character and ends with a character that displays four types of information
???? 1. S section shows the percentage of CPU time utilization used for system behavior
???? The 2. N section shows the CPU time utilization for the adjusted process. These are processes running at a lower priority level
???? 3. The U section shows the percentage of time spent on the user's process
???? 4. The r section shows the percentage of real-time process time utilization
???? The most right portion of the row shows the percentage of start glance to current, average, and highest CPU utilization
???? Two Disk Utilization
???? The disk utilization bar has two sections. Similar to the CPU utilization bar chart, these sections show the percentage of disk utilization for different behaviors
???? 1. Part F shows the file system behavior. This is disk I/O utilization for file read or write operations
???? 2. The V section shows the virtual memory behavior. If this part is large, it indicates that the physical memory of the system is very tense
???? The right portion of the row, showing current, average, and highest disk utilization percentages
???? Three Memory utilization
???? Below the disk utilization bar is the memory utilization bar chart. It's divided into three parts.
???? 1. S section shows the memory used for system processes
???? 2. The U section shows the memory used for the user program
???? 3. Section B shows the memory used for buffer memory
???? The most right portion of the row shows current, average, and highest utilization, which has the same meaning as CPU and disk utilization
???? Four Exchange utilization
???? The use of swap space is divided into two parts
???? 1. The U section shows the swap space in use
???? 2. The r section shows the reserved swap space. Once a process is created, a zone is reserved in the swap area, and a reservation is not used
???? Five Process List
???? Below the screen is a list of processes. This column does not list all of the processes, only those processes that are using system resources. The columns are:
???? Process name Create a command name
???? PID Process ID
???? PPID The process ID of the parent process
???? Priority of the PRI process. This is a number from 0 to 255, the larger the number, the lower the priority
???? User name starts the process's username
???? CPU Util The first number is the percentage of CPU utilization during the last interval. The second number is the percentage of CPU utilization since the start of glance. By default, glance updates this list every 5 seconds
???? Cum CPU utilization of a process
???? Disk IO Rate The first number is the average disk I/O rate at the previous time interval.
???? Two digital glance the average disk I/O rate after startup
???? Total amount of RAM used by an RSS process
???? THD Cnt thread statistics??

Hp-unix system, use the GLANCE-M command to view memory usage for a process:

Text rss/vss:48kb/64kb Data rss/vss:215mb/332mb Stack RSS/VSS:676KB/2.1MB
Shmem rss/vss:0kb/0kb Other RSS/VSS:1.2GB/1.4GB

RSS (resident set size): The process actually exists in the size of the portion of the physical memory. Because a process does not require the entire process to be fully stored in the physical memory.

VSS (Virtual set size): The total size of a process. Only when the process executes, the entire process is rss=vss to the physical memory to be in the

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.