Top Dynamic View Process

Source: Internet
Author: User
Tags cpu usage

Top statistics The first five elements are the statistical information of the whole system

1, the first line is the task queue information and uptime quality command results.

06:47:11 up  6:39,  3 users,  load average:0.00, 0.01, 0.05
06:47:11
Current time
Up  6:39
System run time, format last: minutes
3 Users
Number of current user logins
Load average:0.00, 0.01, 0.05

System load, which is the average length of the task queue, three values were 1 minutes, 5 minutes, 15 minutes ago to

The current average.

In general, the current number of active processes per CPU core is not greater than 3, the system performance is good! That is, the host is a quad-core CPU, so long as the uptime last output of the genetic value of less than 4*3=12 means that the system load is not very serious.

2, the second line, the three behavior process and the CPU information. When there are multiple CPUs, the content may be more than two lines.

367 Total,   2365 sleeping,   0 stopped,   0  zombie% Cpu (s):  0.0 us,  0.3 sy,  0.099.7 ID,  0.0 WA,  0.0 Hi,  0.0 si,  0.0 St
asks:367 Total
Total number of processes
2 Running
Number of processes that are running
365 Sleeping
Number of processes for sleep
0 stopped
Number of processes stopped
0 Zombie                          
Number of zombie processes

%CPU (s):  0.0 US
The system user process uses CPU percentages. Does not include high priority processes. cpu% is calculated by the sum of the CPU usage per core. If you are a 4-core CPU, the kernel 1,CPU usage is 100%, the nuclear 2,cpu usage is 100%, the CPU is higher than 100%, and eventually 200%.
0.3 sy
The process in the kernel consumes CPU percentage.
0.0 ni
CPU percentage of processes that have changed priority within the user process space.
99.7 ID
Percentage of idle CPU.

4, the fourth line behavior memory information.

KiB Mem:  1001332 Total,   340616 free,   171456 used,   489260 buff/ Cachekib Swap:   2097148 Total,  2097036 free,       used.   630508 Avail Mem
Mem:  1001332 Total
Total Physical Memory
171456 used
Total amount of physical memory used
340616 Free
Free physical Memory
489260 buff/Cache
Amount of memory to use as the kernel cache
and free-k a meaning
Swap:  2097148 Total
Total mitigation Area
Used
The amount of swap space it uses
2097036 Free
Available swap space

Second, process information

 PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND  
   
    138  root 
    20  
    0
    0  0  0  R 0.3  0.0  0 : 00.83  rcuos/0  
Pid
Process ID
USER
User name of the process owner
NI
Process priority. NCE value. A negative value represents a high priority, and a positive value represents a low priority.
Res
Actual use of memory size
S
Process status
D non-disruptive sleep state
R Run
S Sleep
T Track/Stop
Z Zombie Process
%cpu
CPU time consumption percentage last updated to current
%MEM
Percentage of physical memory used by the process
time+
Process uses CPU time totals, Unit 1/100s
COMMAND
Command name/command line

Top shortcut keys:

Q exit

M Sort by memory

P Sort by CPU

<> page

To control (close) a process:

Kill sends a signal to the process (stops the process)

Common signals:

1 HUP Reload the configuration file. Similar reboots.

2 INT and CTRL + C are generally used to notify the foreground process to terminate the process

9 KILL Force Terminal

Stop and CTRL + Z like

Pkill = Killall

Priority control:

Nice value -20~19 the smaller the priority the higher the average user 0-19

Role: Run the process at what priority. Default 0

Syntax: Nice-n priority numbers

5 Vim A.txt

Top-p 11755

Renice to modify the priority of a running process

#renice-N 5 PID # Modify Process Priority

Free to view the amount of memory in the system

[Email protected] ~]# free total              used free      shared  buff/cache   Availablemem:         1001332      173436      338476        7144      489420      628508 Swap:        2097148          the     2097036

Buffers Cache read-out content from disk

Cached cache needs to write to disk contents

if=/dev/zero of=a.txt bs=10m count= Recordsthe read-in record of0 +0  Write-out 104857600 bytes ( MB) copied,0.880418 sec,119 mb/sec

Then, at the other terminal, see how fast the cache increases.

[Email protected] ~]# free total              used free      shared  buff/cache   Availablemem:         1001332      170800      235780        7144      594752      629724 Swap:        2097148          the     2097036

Top Dynamic View Process

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.