Bootstrap

Linux查看cpu参数及性能

总核数 = 物理CPU个数 X 每颗物理CPU的核数
总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数

查看物理CPU个数

[root@localhost ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
2

查看每个物理CPU中core的个数(即核数)

[root@localhost ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores	: 4

查看逻辑CPU的个数

[root@localhost ~]# cat /proc/cpuinfo| grep "processor"| wc -l
8

查看CPU信息(型号)

[root@localhost ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
      8  Intel(R) Xeon(R) Bronze 3106 CPU @ 1.70GHz

查看内 存信息

[root@localhost ~]# cat /proc/meminfo
MemTotal:        8039380 kB
MemFree:          247792 kB
MemAvailable:    1857884 kB
Buffers:               0 kB
Cached:          1720012 kB
SwapCached:        43968 kB
Active:          5111252 kB
Inactive:        2097028 kB
Active(anon):    4423812 kB
Inactive(anon):  1073392 kB
Active(file):     687440 kB
Inactive(file):  1023636 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       8257532 kB
SwapFree:        7969788 kB
Dirty:               144 kB
Writeback:             0 kB
AnonPages:       5457420 kB
Mapped:           105652 kB
Shmem:              8936 kB
Slab:             339660 kB
SReclaimable:     205020 kB
SUnreclaim:       134640 kB
KernelStack:       17824 kB
PageTables:        47924 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    12277220 kB
Committed_AS:    8891244 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      160796 kB
VmallocChunk:   34359341052 kB
HardwareCorrupted:     0 kB
AnonHugePages:    231424 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      194496 kB
DirectMap2M:     4032512 kB
DirectMap1G:     4194304 kB
;