Linux View CPU Status

Source: Internet
Author: User
Tags cpu usage

1, Htop

2. Top

Content Explanation:

PID: ID of the process
USER: Process Owner
PR: The priority level of the process, the smaller the higher the priority is executed
Ninice: Value
VIRT: Virtual memory consumed by the process
RES: The physical memory occupied by the process
SHR: Shared memory used by the process
S: The state of the process. s for hibernation, R for running, Z for Zombie, n for the process priority value is negative
%CPU: Process Consuming CPU utilization
%MEM: The percentage of physical memory and total memory used by the process
Time+: The total CPU time that is consumed after the process is started, which is the cumulative value of the CPU usage time.
Command: Process start name

3,Cat/proc/stat

4.

Pmap

Depending on the process, you can view the memory used by the process-related information (the process number can be viewed by PS) as follows:
$ pmap-d 5647

Ps

As shown in the following example:
$ ps-e-O ' pid,comm,args,pcpu,rsz,vsz,stime,user,uid ' where Rsz is the actual memory
$ ps-e-o ' pid,comm,args,pcpu,rsz,vsz,stime,user,uid ' |  grep Oracle | Sort-nrk

Where Rsz is the actual memory, the above example is implemented by memory sort, from large to small

View memory under Linux We generally use the free command:
[[email protected] tmp]# free
              total       used        free     shared    buffers     Cached
Mem:        3266180    3250004      16176           0     110652    2668236
-/+ buffers/cache:     471116    2795064
swap:      2048276      80160    1968116

Here is an explanation of these values:
Total: The amount of physical memory.
Used: How large is used.
Free: How much is available.
Shared: The total amount of memory shared by multiple processes.
Buffers/cached: The size of the disk cache.
Third line (-/+ buffers/cached):
Used: How large is used.
Free: How much is available.
There is not much to explain in line four.
Difference: The used/free of the second line (MEM) differs from the third row (-/+ Buffers/cache) used/free. The difference between the two is that the first line is from the OS point of view, because for the os,buffers/cached are all belong to be used, so his available memory is 16176KB, the used memory is 3250004KB, which includes, the kernel (OS) uses + Application (X, ORACLE,ETC) uses the +buffers+cached.
The third line refers to the application from the point of view, buffers/cached is equal to the availability of the application, because buffer/cached is to improve the performance of the file read, when the application needs to use memory, buffer/cached will be quickly recycled.
So from the application's point of view, available memory = System Free memory+buffers+cached.
As in the above example:
2795064=16176+110652+2668236

Next, explain when the memory will be exchanged, and by what side. When the available memory is less than the rated value, a meeting is exchanged.
How to see the rating:
Cat/proc/meminfo

[Email protected] tmp]# Cat/proc/meminfo
memtotal:3266180 KB
memfree:17456 KB
buffers:111328 KB
cached:2664024 KB
swapcached:0 KB
active:467236 KB
inactive:2644928 KB
hightotal:0 KB
highfree:0 KB
lowtotal:3266180 KB
lowfree:17456 KB
swaptotal:2048276 KB
swapfree:1968116 KB
Dirty:8 KB
writeback:0 KB
mapped:345360 KB
slab:112344 KB
committed_as:535292 KB
pagetables:2340 KB
vmalloctotal:536870911 KB
vmallocused:272696 KB
vmallocchunk:536598175 KB
hugepages_total:0
hugepages_free:0
hugepagesize:2048 KB

Results viewed with free-m:
[Email protected] tmp]# free-m
Total used free shared buffers Cached
mem:3189 3173 16 0 107 2605
-/+ buffers/cache:460 2729
swap:2000 78 1921

Linux View CPU Status

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.