Skip to content

Instantly share code, notes, and snippets.

@BruceChen7
Created July 15, 2022 13:39
Show Gist options
  • Save BruceChen7/74aac06cf5796ab98e9193bc449ab422 to your computer and use it in GitHub Desktop.
Save BruceChen7/74aac06cf5796ab98e9193bc449ab422 to your computer and use it in GitHub Desktop.
#linux#smp#ebpf

参考资料

命令

cat /proc/cpuinfo

[root@zorrozou-pc	~/test]#	cat	/proc/cpuinfo
processor				:	23
vendor_id				:	GenuineIntel
cpu	family				:	6
model					:	63
model	name			:	Intel(R)	Xeon(R)	CPU	E5-2620	v3	@	2.40GHz
stepping				:	2
microcode				:	0x2b
cpu	MHz					:	2599.968
cache	size			:	15360	KB
physical	id			:	1
siblings				:	12
core	id				:	5
cpu	cores				:	6
apicid					:	27
initial	apicid			:	27
fpu						:	yes
fpu_exception			:	yes
cpuid	level			:	15
wp						:	yes
flags					:	fpu	vme	de	pse	tsc	msr	pae	mce	cx8	apic	sep	mtrr	pge	mca	cmov	pat	pse36
	clflush	dts	acpi	mmx	fxsr	sse	sse2	ss	ht	tm	pbe	syscall	nx	pdpe1gb	rdtscp	lm	constant
_tsc	arch_perfmon	pebs	bts	rep_good	nopl	xtopology	nonstop_tsc	aperfmperf	eagerfpu	pni
	pclmulqdq	dtes64	monitor	ds_cpl	vmx	smx	est	tm2	ssse3	fma	cx16	xtpr	pdcm	pcid	dca	sse
4_1	sse4_2	x2apic	movbe	popcnt	tsc_deadline_timer	aes	xsave	avx	f16c	rdrand	lahf_lm	ab
m	ida	arat	epb	xsaveopt	pln	pts	dtherm	tpr_shadow	vnmi	flexpriority	ept	vpid	fsgsbase	
tsc_adjust	bmi1	avx2	smep	bmi2	erms	invpcid
bogomips				:	4796.38
clflush	size				:	64
cache_alignment				:	64
address	sizes				:	46	bits	physical,	48	bits	virtual
power	management:

processor: 23是核心编号,说明显示这个服务器是第24个核心,physical id: 1表示这个核心所在的物理CPU是哪个?表示这个核心在第二个物理CPU上。这个服务器是一个双物理cpu的服务器,那就可能意味着我们的系统是NUMA架构。另外还有一个要注意的是core id : 5这个子段,这里面隐含着一个可能的含义:你的服务器是否开启了超线程

[root@zorrozou-pc	~/test]# cat/proc/cpuinfo | grep -e	"core id" -e "physical	id"
physical	id				:	0
core	id								:	0
physical	id				:	0
core	id								:	1
physical	id				:	0
core	id								:	2
physical	id				:	0
core	id								:	3
physical	id				:	0
core	id								:	4
physical	id				:	0
core	id								:	5
physical	id				:	1
core	id								:	0
physical	id				:	1
core	id								:	1
physical	id				:	1
core	id								:	2
physical	id				:	1
core	id								:	3
physical	id				:	1
core	id								:	4
physical	id				:	1
core	id								:	5
physical	id				:	0
core	id								:	0
physical	id				:	0
core	id								:	1
physical	id				:	0
core	id								:	2
physical	id				:	0
core	id								:	3
physical	id				:	0
core	id								:	4
physical	id				:	0
core	id								:	5
physical	id				:	1
core	id								:	0
physical	id				:	1
core	id								:	1
physical	id				:	1
core	id								:	2
physical	id				:	1
core	id								:	3
physical	id				:	1
core	id								:	4
physical	id				:	1
core	id								:	5

这个内容显示出我的服务器是开启了超线程的,因为有同一个physical id : 1的core id : 5可能出现两次,那么就说明这个物理cpu上的5号核心在系统看来出现了2个,那么肯定意味着开了超线程。

查看进程流量

yum install -y nethogs

#linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment