我们的 SPARC 服务器运行的是 Sun Solaris 10;我想找出处理器的实际数量以及每个处理器的核心数量。
psrinfo 和 prtdiag 的输出不明确:
$psrinfo -v
Status of virtual processor 0 as of: dd/mm/yyyy hh:mm:ss
on-line since dd/mm/yyyy hh:mm:ss.
The sparcv9 processor operates at 1592 MHz,
and has a sparcv9 floating point processor.
Status of virtual processor 1 as of: dd/mm/yyyy hh:mm:ss
on-line since dd/mm/yyyy hh:mm:ss.
The sparcv9 processor operates at 1592 MHz,
and has a sparcv9 floating point processor.
Status of virtual processor 2 as of: dd/mm/yyyy hh:mm:ss
on-line since dd/mm/yyyy hh:mm:ss.
The sparcv9 processor operates at 1592 MHz,
and has a sparcv9 floating point processor.
Status of virtual processor 3 as of: dd/mm/yyyy hh:mm:ss
on-line since dd/mm/yyyy hh:mm:ss.
The sparcv9 processor operates at 1592 MHz,
and has a sparcv9 floating point processor.
_
$prtdiag -v
System Configuration: Sun Microsystems sun4u Sun Fire V445
System clock frequency: 199 MHZ
Memory size: 32GB
==================================== CPUs ====================================
E$ CPU CPU
CPU Freq Size Implementation Mask Status Location
--- -------- ---------- --------------------- ----- ------ --------
0 1592 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 on-line MB/C0/P0
1 1592 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 on-line MB/C1/P0
2 1592 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 on-line MB/C2/P0
3 1592 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 on-line MB/C3/P0
_
$more /etc/release
Solaris 10 8/07 s10s_u4wos_12b SPARC
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 16 August 2007
Patch Cluster - EIS 29/01/08(v3.1.5)
我还可以使用哪些其他方法?
編輯:
看起来我们有一个 4 处理器系统,每个处理器有一个核心:
$psrinfo -p
4
_
$psrinfo -pv
The physical processor has 1 virtual processor (0)
UltraSPARC-IIIi (portid 0 impl 0x16 ver 0x34 clock 1592 MHz)
The physical processor has 1 virtual processor (1)
UltraSPARC-IIIi (portid 1 impl 0x16 ver 0x34 clock 1592 MHz)
The physical processor has 1 virtual processor (2)
UltraSPARC-IIIi (portid 2 impl 0x16 ver 0x34 clock 1592 MHz)
The physical processor has 1 virtual processor (3)
UltraSPARC-IIIi (portid 3 impl 0x16 ver 0x34 clock 1592 MHz)
答案1
该命令psrinfo -pv
就是您要查找的命令。它为您提供物理 CPU 的数量以及每个物理处理器的虚拟处理器数量。
例如在 V880 上它看起来像这样:
The physical processor has 1 virtual processor (0)
UltraSPARC-III+ (portid 0 impl 0x15 ver 0x23 clock 900 MHz)
The physical processor has 1 virtual processor (1)
UltraSPARC-III+ (portid 1 impl 0x15 ver 0x23 clock 900 MHz)
The physical processor has 1 virtual processor (2)
UltraSPARC-III+ (portid 2 impl 0x15 ver 0x23 clock 900 MHz)
The physical processor has 1 virtual processor (3)
UltraSPARC-III+ (portid 3 impl 0x15 ver 0x23 clock 900 MHz)
The physical processor has 1 virtual processor (4)
UltraSPARC-III+ (portid 4 impl 0x15 ver 0x23 clock 900 MHz)
The physical processor has 1 virtual processor (5)
UltraSPARC-III+ (portid 5 impl 0x15 ver 0x23 clock 900 MHz)
The physical processor has 1 virtual processor (6)
UltraSPARC-III+ (portid 6 impl 0x15 ver 0x23 clock 900 MHz)
The physical processor has 1 virtual processor (7)
UltraSPARC-III+ (portid 7 impl 0x15 ver 0x23 clock 900 MHz)
希望有所帮助。:-)
编辑
多核机器有例如这个输出
The physical processor has 4 virtual processors (0-3)
SPARC64-VI (portid 1024 impl 0x6 ver 0x93 clock 2150 MHz)
The physical processor has 4 virtual processors (8-11)
SPARC64-VI (portid 1032 impl 0x6 ver 0x93 clock 2150 MHz)
答案2
您可以使用 psrinfo -p 命令检查物理处理器的数量。
root@sunt2000:/# uname -a SunOS sunt2000 5.10 Generic_139555-08 sun4v sparc SUNW,Sun-Fire-T200
检查物理处理器的数量
root@sunt2000:/#psrinfo
-p 1
来自上述相同命令的详细输出。
root@sunt2000:/# psrinfo -vp
物理处理器有32个虚拟处理器(0-31)
UltraSPARC-T1(芯片 ID 0,时钟频率 1200 MHz)
下面是配备 UltraSPARC IIIi 且单核的 Sun Fire V445。
root@sunv445:/# uname -a
SunOS sunv445 5.10 Generic_120011-14 sun4u sparc SUNW、Sun-Fire-V445
root@sunv445:/# psrinfo
自 2008 年 11 月 5 日 04:27:24 以来有 0 人在线
自 2008 年 11 月 5 日 04:27:24 以来有 1 人在线
自 2008 年 11 月 5 日 04:27:16 以来有 2 人在线
它有3个物理处理器。
root@sunv445:/# psrinfo -p
3
我相信只有 UltraSPARCs IV 是双核的。IIIi 没有问题
root@sunv445:/# psrinfo -vp
物理处理器有 1 个虚拟处理器 (0)
UltraSPARC-IIIi(端口 ID 0 实现 0x16 版本 0x34 时钟 1592 MHz)
物理处理器有 1 个虚拟处理器 (1)
UltraSPARC-IIIi(端口 ID 1 实现 0x16 版本 0x34 时钟 1592 MHz)
物理处理器有 1 个虚拟处理器 (2)
UltraSPARC-IIIi(端口 ID 2 实现 0x16 版本 0x34 时钟 1592 MHz)
答案3
系统中的核心总数是“kstat cpu_info | grep core_id | uniq | wc -l”,将核心总数除以“psrinfo -p”的输出,即可得到每个物理处理器的核心数
答案4
总是有
dmesg
不过我怀疑你的 prtdiag -v 在位置字段中很好地列出了核心。看起来你有一个四核 CPU?