wtuyss 发表于 2019-2-15 15:50:30

Centos 查看内存和CPU


[*]查看内存使用
  free -mh

[*]读出的内核信息进行解释
  cat /proc/meminfo
  MemTotal:   16438852 kB#所有可用RAM大小 (即物理内存减去一些预留位和内核的二进制代码大小)
MemFree:      10980184 kB#LowFree与HighFree的总和,被系统留着未使用的内存
Buffers:         95884 kB#用来给文件做缓冲大小
Cached:         224108 kB#被高速缓冲存储器(cache memory)用的内存的大小(等于 diskcache minus SwapCache)
SwapCached:          0 kB#被高速缓冲存储器(cache memory)用的交换空间的大小 已经被交换出来的内存,但仍然被存放在swapfile中。用来在需要的时候很快的被替换而不需要再次打开I/O端口。
Active:      5161616 kB#在活跃使用中的缓冲或高速缓冲存储器页面文件的大小,除非非常必要否则不会被移作他用.
Inactive:       217660 kB#在不经常使用中的缓冲或高速缓冲存储器页面文件的大小,可能被用于其他途径.
HighTotal:         0 kB
HighFree:            0 kB
LowTotal:   16438852 kB
LowFree:      10980184 kB
SwapTotal:   1048536 kB
SwapFree:      1048536 kB
Dirty:             424 kB
Writeback:         0 kB
AnonPages:   5059312 kB
Mapped:          20424 kB
Slab:            38176 kB
PageTables:      13480 kB
NFS_Unstable:      0 kB
Bounce:            0 kB
CommitLimit:   9267960 kB
Committed_AS: 10073960 kB
VmallocTotal: 34359738367 kB
VmallocUsed:    263672 kB
VmallocChunk: 34359473751 kB
HugePages_Total:   0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:   2048 kB
  查看CPU内核数,physical id不同数字的数量是几个就是几个CPU,cpu cores : 2代表是2核,如下是一个2核的cpu
  # cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family: 6
model       : 45
model name: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz
stepping    : 7
microcode   : 0x714
cpu MHz   : 1999.999
cache size: 15360 KB
physical id : 0
siblings    : 2
core id   : 0
cpu cores   : 2
apicid      : 0
initial apicid: 0
fpu   : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm tsc_adjust dtherm ida arat pln pts
bogomips    : 3999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:
  processor   : 1
vendor_id   : GenuineIntel
cpu family: 6
model       : 45
model name: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz
stepping    : 7
microcode   : 0x714
cpu MHz   : 1999.999
cache size: 15360 KB
physical id : 0
siblings    : 2
core id   : 1
cpu cores   : 2
apicid      : 1
initial apicid: 1
fpu   : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm tsc_adjust dtherm ida arat pln pts
bogomips    : 3999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual



页: [1]
查看完整版本: Centos 查看内存和CPU