View CPU, memory, and disk information under Linux

Source: Internet
Author: User
Tags cpu usage

1. View CPU Information
# total number of cores = number of physical CPUs X number of cores per physical CPU
# Total Logical CPUs = number of physical CPUs x number of cores per physical CPU X number of hyper-threads

# View the number of physical CPUs
cat/proc/cpuinfo| grep "Physical ID" | Sort| uniq| Wc-l

# See the number of cores in each physical CPU (that is, the number of nuclei)
cat/proc/cpuinfo| grep "CPU Cores" | Uniq

# View the number of logical CPUs
cat/proc/cpuinfo| grep "Processor" | Wc-l

# View CPU information (model)
Cat/proc/cpuinfo | grep name | Cut-f2-d: | Uniq-c

#查看CPU的负载
The average load is the average number of processes that have been in the ready state for the previous minute. The CPU can be understood as the number of tasks that the CPU can process in parallel, that is, CPU x number of cores.
If the CPU load is equal to the number of CPUs multiplied by the number of cores, then it is said that the CPU is just full load, a little more, it may be a problem, some tasks can not be allocated timely processor, that to ensure performance, it is best to be smaller than the number of CPUs x X0.7.
Load average refers to the load of the CPU. It contains information about the sum of the number of processes that the CPU is processing and waiting for CPU processing over a period of time, which is the statistic of the length of the CPU usage queue.
The value of load average should be less than the number of CPUs x cores X0.7,load average will have 3 status averages, 1 minutes, 5 minutes, and 15 minute average load respectively.
If the average of 1 minutes is greater than the number of CPUs x number of cases, there is no need to worry about, if the 5 minutes of the average is the case, it should be vigilant, 15 minutes of the average is the case, it is necessary to analyze where problems arise, to prevent the situation.
#CPU负载信息, use the top command
Top-15:50:31 up 4 days, 23:43, 1 user, load average:0.51, 0.29, 0.37
tasks:492 Total, 1 running, 490 sleeping, 1 stopped, 0 zombie
Cpu (s): 6.4%us, 0.1%sy, 0.0%ni, 93.4%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st
mem:65973912k Total, 32468632k used, 33505280k free, 906712k buffers
swap:41943032k Total, 13204k used, 41929828k free, 6434448k cached

2. View memory Information
1), Cat/proc/meminfo
2), free command
Total used free shared buffers Cached
mem:65973912 32496232 33477680 0 906932 6452984
-/+ buffers/cache:25136316 40837596
swap:41943032 13204 41929828

3. View disk Information
1) fdisk-l
2) Iostat-x 10 View the performance of disk IO
[Email protected] bin]# Iostat-x 10
Linux 2.6.32-358.el6.x86_64 (XDPP02) 11/30/2016 _x86_64_ (CPU)
AVG-CPU:%user%nice%system%iowait%steal%idle
3.86 0.00 0.17 0.06 0.00 95.90
device:rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await SVCTM%util
SDA 0.77 84.89 0.62 3.11 15.72 703.97 193.03 0.12 31.10 2.86 1.07
dm-0 0.00 0.00 0.15 0.22 2.93 1.78 12.75 0.00 12.42 3.77 0.14
Dm-1 0.00 0.00 0.09 0.10 0.75 0.83 8.00 0.00 14.53 0.28 0.01
Dm-2 0.00 0.00 0.00 0.57 0.03 4.52 8.00 0.01 22.24 4.84 0.28
Dm-3 0.00 0.00 0.01 3.10 1.58 24.82 8.48 0.03 11.16 1.05 0.33
Dm-4 0.00 0.00 0.03 0.00 0.27 0.00 8.00 0.00 0.52 0.10 0.00
Dm-5 0.00 0.00 1.11 84.00 10.11 672.02 8.01 3.62 42.54 0.07 0.61

View CPU, memory, and disk information under Linux

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.