centos7查看系统硬件信息

笔记-/proc/查看系统硬件信息

CPU信息:
1、利用文件进行查看
cat /proc/cpuinfo

physical id : 0 ----CPU颗数
processor : 0 ----CPU核数
cpu cores : 1 ----CPU核数
model name : Intel® Core™ i5-7300HQ CPU @ 2.50GHz —CPU品牌型号

	CPU颗数举例:
		physical id	: 0	第一段---------------
								相同字段合并	|	physical id	: 0	---第1颗CPU	————|  	
		physical id	: 0	第二段---------------                               		|
						                                                        |共计2颗CPU
		physical id	: 1	第三段|——————————————|              	                    |
								相同字段合并		physical id	: 1	---第2颗CPU	————| 
		physical id	: 1	第四段|——————————————|

	CPU核数举例:
		physical id	: 0		processor	: 0|
		physical id	: 0		processor	: 1|---1颗CPU有2核心
		cpu cores	: 2					   |

		physical id	: 1		processor	: 0|
		physical id	: 1		processor	: 1|---1颗CPU有2核心
		cpu cores	: 2					   |

	测试服务器配置为2*2
	[root@Qin ~]# cat /proc/cpuinfo 
	processor	: 0
	vendor_id	: GenuineIntel
	cpu family	: 6
	model		: 158
	model name	: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
	stepping	: 9
	microcode	: 0xb4
	cpu MHz		: 2496.004
	cache size	: 6144 KB
	physical id	: 0
	siblings	: 2
	core id		: 0
	cpu cores	: 2
	apicid		: 0
	initial apicid	: 0
	fpu		: yes
	fpu_exception	: yes
	cpuid level	: 22
	wp		: yes
	flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gbrdtscp lm 			constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1sse4_2 x2apic movbe popcnt 			tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbasetsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx 			smap clflushopt xsaveopt xsavec ibpb ibrs stibp arat spec_ctrlintel_stibp arch_capabilities
	bogomips	: 4992.00
	clflush size	: 64
	cache_alignment	: 64
	address sizes	: 43 bits physical, 48 bits virtual
	power management:
	------------------------------------------------------------上为第一段信息内容----------------------------------------					
	processor	: 1
	vendor_id	: GenuineIntel
	cpu family	: 6
	model		: 158
	model name	: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
	stepping	: 9
	microcode	: 0xb4
	cpu MHz		: 2496.004
	cache size	: 6144 KB
	physical id	: 0
	siblings	: 2
	core id		: 1
	cpu cores	: 2
	apicid		: 1
	initial apicid	: 1
	fpu		: yes
	fpu_exception	: yes
	cpuid level	: 22
	wp		: yes
	flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gbrdtscp lm 			constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1sse4_2 x2apic movbe popcnt 			tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbasetsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx 			smap clflushopt xsaveopt xsavec ibpb ibrs stibp arat spec_ctrlintel_stibp arch_capabilities
	bogomips	: 4992.00
	clflush size	: 64
	cache_alignment	: 64
	address sizes	: 43 bits physical, 48 bits virtual
	power management:
	------------------------------------------------------------上为第二段信息内容----------------------------------------
	processor	: 2
	vendor_id	: GenuineIntel
	cpu family	: 6
	model		: 158
	model name	: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
	stepping	: 9
	microcode	: 0xb4
	cpu MHz		: 2496.004
	cache size	: 6144 KB
	physical id	: 1
	siblings	: 2
	core id		: 0
	cpu cores	: 2
	apicid		: 2
	initial apicid	: 2
	fpu		: yes
	fpu_exception	: yes
	cpuid level	: 22
	wp		: yes
	flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gbrdtscp lm 			constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1sse4_2 x2apic movbe popcnt 			tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbasetsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx 			smap clflushopt xsaveopt xsavec ibpb ibrs stibp arat spec_ctrlintel_stibp arch_capabilities
	bogomips	: 4992.00
	clflush size	: 64
	cache_alignment	: 64
	address sizes	: 43 bits physical, 48 bits virtual
	power management:
	------------------------------------------------------------上为第三段信息内容----------------------------------------
	processor	: 3
	vendor_id	: GenuineIntel
	cpu family	: 6
	model		: 158
	model name	: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
	stepping	: 9
	microcode	: 0xb4
	cpu MHz		: 2496.004
	cache size	: 6144 KB
	physical id	: 1
	siblings	: 2
	core id		: 1
	cpu cores	: 2
	apicid		: 3
	initial apicid	: 3
	fpu		: yes
	fpu_exception	: yes
	cpuid level	: 22
	wp		: yes
	flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gbrdtscp lm 			constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1sse4_2 x2apic movbe popcnt 			tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbasetsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx 			smap clflushopt xsaveopt xsavec ibpb ibrs stibp arat spec_ctrlintel_stibp arch_capabilities
	bogomips	: 4992.00
	clflush size	: 64
	cache_alignment	: 64
	address sizes	: 43 bits physical, 48 bits virtual
	power management:
	------------------------------------------------------------上为第四段信息内容----------------------------------------

2、利用命令查看
lscpu 实际调取cpuinfo文件内容,换方式显示

	[root@Qin ~]# lscpu
	Architecture:          x86_64
	CPU op-mode(s):        32-bit, 64-bit
	Byte Order:            Little Endian
	CPU(s):                4	-------------CPU共几核
	On-line CPU(s) list:   0-3	-------------CPU列表数4
	Thread(s) per core:    1
	Core(s) per socket:    2	-------------每个CPU插槽核心数
	Socket(s):             2	-------------CPU插槽数
	NUMA node(s):          1
	Vendor ID:             GenuineIntel
	CPU family:            6
	Model:                 158
	Model name:            Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
	Stepping:              9
	CPU MHz:               2496.004
	BogoMIPS:              4992.00
	Hypervisor vendor:     VMware
	Virtualization type:   full
	L1d cache:             32K		
	L1i cache:             32K
	L2 cache:              256K
	L3 cache:              6144K
	NUMA node0 CPU(s):     0-3
	Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb 		rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe 		popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed 		adx smap clflushopt xsaveopt xsavec ibpb ibrs stibp arat spec_ctrl intel_stibp arch_capabilities

CPU负载信息(CPU繁忙处理任务过多)
1、利用文件查看
cat /proc/loadavg

		[root@Qin ~]# cat /proc/loadavg 
		0.00 		0.01 		0.05 		1/134 1571
		----		----		----		----------
		01			02			03				04

		01:CPU一分钟平均负载
		02:CPU五分钟平均负载
		03:CPU十五分钟平均负载
		04:分子是当前正在运行的进程数,分母是总的进程数;1571(最近运行进程的ID)

		PS:CPU负载值与核数有关
			一个进程只能处理一个任务。假设系统有两个CPU,CPU一分钟平均负载为8.13,那么当前任务数为:8.13/2=4.065
			24核服务器,负载值在20左右需要关注。重点关注03项,15分钟平均负载。

	2、利用命令查看
		a.w

		b.uptime

		[root@Qin ~]# w
		 03:27:05 up  1:54,  1 user,  load average: 0.00, 0.01, 0.05
		USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
		root     pts/0    10.0.0.1         01:33    1.00s  0.13s  0.00s w

		[root@Qin ~]# uptime
		 03:27:32 up  1:55,  1 user,  load average: 0.00, 0.01, 0.05
		 -----------------   -------
		 	时间				几个用户登陆

内存信息
1、利用文件查看内存信息
cat /proc/meminfo

	[root@Qin ~]# cat /proc/meminfo 		
	MemTotal:         997980 KB  ---内存总容量
	MemFree:          713164 KB  ---空闲内存容量
	MemAvailable:     693908 kB  ---可用内存容量
	Buffers:            2088 kB  ---buffers空间,缓冲区缓存
	Cached:            89912 kB  ---cache空间,页面缓存
	SwapCached:            0 kB  ---交换分区容量

2、利用命令查看内存信息
	free
	free -h 以人类可读显示

	[root@Qin ~]# free -h
          		  total        used        free      shared  buff/cache   available
	Mem:           974M        129M        696M        7.6M        148M        677M
	Swap:          2.0G          0B        2.0G
                                                                          ——————————
                                                          available应用程序可使用的内存大小,当消耗完之后会使用swap

centos7查看系统硬件信息_第1张图片

磁盘挂载信息
1、利用文件查看
cat /proc/mounts 查看系统详细的挂载信息

	[root@Qin ~]# cat /proc/mounts
	rootfs / rootfs rw 0 0
	sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
	proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
	devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=487964k,nr_inodes=121991,mode=755 0 0
	securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
	tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0
	devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
	tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
	tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0

2、利用命令查看
df
df -h 以人类可读方式显示

	[root@Qin ~]# df -h
	Filesystem      Size  Used Avail Use% Mounted on
	/dev/sda3        18G  1.6G   17G   9% /
	devtmpfs        477M     0  477M   0% /dev
	tmpfs           488M     0  488M   0% /dev/shm
	tmpfs           488M  7.7M  480M   2% /run
	tmpfs           488M     0  488M   0% /sys/fs/cgroup
	/dev/sda1       197M  102M   95M  52% /boot
	/dev/sr0        1.9G  1.9G     0 100% /mnt
	tmpfs            98M     0   98M   0% /run/user/0

你可能感兴趣的:(笔记,linux,运维)