1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > linux 查询系统CPU核数 线程数

linux 查询系统CPU核数 线程数

时间:2022-08-23 03:33:51

相关推荐

linux 查询系统CPU核数 线程数

1. 查看CPU型号

~$ cat /proc/cpuinfo | grep name | sort | uniqmodel name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz

2. 查看物理CPU数目

~$ cat /proc/cpuinfo | grep "physical id"physical id: 0physical id: 0physical id: 0physical id: 0physical id: 0physical id: 0physical id: 0physical id: 0

所有physical id都是0,可知有1个物理CPU;也用管道排序去重后直接输出物理cpu的个数:

~$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l1

3. 查看核数和逻辑CPU数目

CPU核数和线程数可以用类似方法

~$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l1~$ cat /proc/cpuinfo | grep "core id" | sort | uniq | wc -l4~$ cat /proc/cpuinfo | grep "processor" | sort | uniq | wc -l8

由图可知:1颗物理CPU,4核8线程;

4 . 如果不想自己算,也可以直接lscpu

~$ lscpuArchitecture:x86_64CPU op-mode(s): 32-bit, 64-bitByte Order: Little EndianCPU(s):8On-line CPU(s) list: 0-7Thread(s) per core: 2Core(s) per socket: 4Socket(s): 1NUMA node(s):1Vendor ID: GenuineIntelCPU family: 6Model: 94Model name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHzStepping: 3CPU MHz:900.055CPU max MHz: 3500.0000CPU min MHz: 800.0000BogoMIPS: 5184.00Virtualization: VT-xL1d cache: 32KL1i cache: 32KL2 cache: 256KL3 cache: 6144KNUMA node0 CPU(s):0-7Flags: 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 art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d

只有1个cpu,4核,支持超线程即每个核对应2个线程,共有8个逻辑线程。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。