|
CPU的核心数是指物理上,也就是硬件上存在着几颗物理cpu,指的是真实存在的cpu处理器的个数,1个代表1颗cpu,2个代表2颗cpu处理器。
核心数:一个核心就是一个物理线程,英特尔有个超线程技术可以把一个物理线程模拟出两个线程来用,充分发挥CPU性能,意思是一个核心可以有多个线程。
线程数:线程数是一种逻辑的概念,简单地说,就是模拟出的CPU核心数。比如,可以通过一个CPU核心数模拟出2线程的CPU,也就是说,这个单核心的CPU被模拟成了一个类似双核心CPU的功能。
如何获得cpu的详细信息
命令:cat /proc/cpuinfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| [iyunv@localhost ~]# cat /proc/cpuinfo
processor: 0
vendor_id: GenuineIntel
cpu family: 6
model: 15
model name: Intel(R) Xeon(R) CPU E5320 @ 1.86GHz
stepping: 7
cpu MHz: 1862.039
cache size: 4096 KB
physical id: 0
siblings: 4
core id: 0
cpu cores: 4
apicid: 0
initial apicid: 0
fdiv_bug: no
hlt_bug: no
f00f_bug: no
coma_bug: no
fpu: yes
fpu_exception: yes
cpuid level: 10
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 nx lm constant_tsc arch_perfmon pebs bts tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni ssse3 cx16 x2apic hypervisor lahf_lm dts
bogomips: 3724.07
clflush size: 64
cache_alignment: 64
address sizes: 40 bits physical, 48 bits virtual
power management:
|
查看物理CPU的个数
命令:grep -i "physical id" /proc/cpuinfo |sort | uniq |wc -l
1
2
| [iyunv@localhost ~]# grep -i "physical id" /proc/cpuinfo |sort |uniq |wc -l
1
|
查看CPU线程的个数
命令:grep -c "processor" /proc/cpuinfo
1
2
| [iyunv@localhost ~]# cat /proc/cpuinfo |grep -c "processor"
4
|
查看有几个逻辑核心
命令:grep -c "core id" /proc/cpuinfo
1
2
| [iyunv@localhost ~]# cat /proc/cpuinfo |grep -c "core id"
4
|
查看CPU的主频
命令:cat /proc/cpuinfo |grep "MHz"|uniq
1
2
| [iyunv@localhost ~]# cat /proc/cpuinfo |grep "MHz"|uniq
cpu MHz : 1862.039
|
查看CPU的型号和线程数
命令: cat /proc/cpuinfo |grep name|cut -d: -f 2|uniq -c
1
2
| [iyunv@localhost ~]# cat /proc/cpuinfo |grep name|cut -d: -f 2|uniq -c
4 Intel(R) Xeon(R) CPU E5320 @ 1.86GHz
|
processor 逻辑cpu,线程,从0开始(比如8个线程cpu为0-7)
core id 逻辑核心数,也是从0开始;
查看当前linux系统的内核信息
命令:uname -a 详细显示内核信息
1
2
| [iyunv@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-431.el6.i686 #1 SMP Fri Nov 22 00:26:36 UTC 2013 i686 i686 i386 GNU/Linux
|
命令:uname -r 只查看内核版本
1
2
| [iyunv@localhost ~]# uname -r
2.6.32-431.el6.i686
|
|
|