AIX 查看服务器CPU个数

简介: 系统中有很多命令可以查看cpu的个数,但是哪个命令输出的是逻辑cpu个数,哪个又是物理cpu个数呢?      从AIX5.3起,系统引入了SMT(Simultaneous multi-threading:同步多线程)的功能,其允许两个处理线程在同一颗处理器上运行,对操作系统而言,一颗物理处理器逻辑上会成为两个处理单元(逻辑处理器)。

系统中有很多命令可以查看cpu的个数,但是哪个命令输出的是逻辑cpu个数,哪个又是物理cpu个数呢?
      从AIX5.3起,系统引入了SMT(Simultaneous multi-threading:同步多线程)的功能,其允许两个处理线程在同一颗处理器上运行,对操作系统而言,一颗物理处理器逻辑上会成为两个处理单元(逻辑处理器)。也就是说,在SMT功能启用的情况下,逻辑cpu个数是物理cpu个数的两倍,而在SMT功能禁用的情况下,逻辑cpu个数与物理cpu个数相等。
      下面我们介绍如何通过各种命令检查系统中的物理cpu和逻辑cpu的个数。
1. smtctl
        # smtctl 

This system is SMT capable.
This system supports up to 4 SMT threads per processor.
SMT is currently enabled.
SMT boot mode is not set.
SMT threads are bound to the same physical processor.

proc0 has 4 SMT threads.
Bind processor 0 is bound with proc0
Bind processor 1 is bound with proc0
Bind processor 2 is bound with proc0
Bind processor 3 is bound with proc0

proc4 has 4 SMT threads.
Bind processor 4 is bound with proc4
Bind processor 5 is bound with proc4
Bind processor 6 is bound with proc4
Bind processor 7 is bound with proc4

proc8 has 4 SMT threads.
Bind processor 8 is bound with proc8
Bind processor 9 is bound with proc8
Bind processor 10 is bound with proc8
Bind processor 11 is bound with proc8

proc12 has 4 SMT threads.
Bind processor 12 is bound with proc12
Bind processor 13 is bound with proc12
Bind processor 14 is bound with proc12
Bind processor 15 is bound with proc12

proc16 has 4 SMT threads.
Bind processor 16 is bound with proc16
Bind processor 17 is bound with proc16
Bind processor 18 is bound with proc16
Bind processor 19 is bound with proc16

proc20 has 4 SMT threads.
Bind processor 20 is bound with proc20
Bind processor 21 is bound with proc20
Bind processor 22 is bound with proc20
Bind processor 23 is bound with proc20

proc24 has 4 SMT threads.
Bind processor 24 is bound with proc24
Bind processor 25 is bound with proc24
Bind processor 26 is bound with proc24
Bind processor 27 is bound with proc24

proc28 has 4 SMT threads.
Bind processor 28 is bound with proc28
Bind processor 29 is bound with proc28
Bind processor 30 is bound with proc28
Bind processor 31 is bound with proc28

proc32 has 4 SMT threads.
Bind processor 32 is bound with proc32
Bind processor 33 is bound with proc32
Bind processor 34 is bound with proc32
Bind processor 35 is bound with proc32

proc36 has 4 SMT threads.
Bind processor 36 is bound with proc36
Bind processor 37 is bound with proc36
Bind processor 38 is bound with proc36
Bind processor 39 is bound with proc36

proc40 has 4 SMT threads.
Bind processor 40 is bound with proc40
Bind processor 41 is bound with proc40
Bind processor 42 is bound with proc40
Bind processor 43 is bound with proc40

proc44 has 4 SMT threads.
Bind processor 44 is bound with proc44
Bind processor 45 is bound with proc44
Bind processor 46 is bound with proc44
Bind processor 47 is bound with proc44

proc48 has 4 SMT threads.
Bind processor 48 is bound with proc48
Bind processor 49 is bound with proc48
Bind processor 50 is bound with proc48
Bind processor 51 is bound with proc48

proc52 has 4 SMT threads.
Bind processor 52 is bound with proc52
Bind processor 53 is bound with proc52
Bind processor 54 is bound with proc52
Bind processor 55 is bound with proc52

proc56 has 4 SMT threads.
Bind processor 56 is bound with proc56
Bind processor 57 is bound with proc56
Bind processor 58 is bound with proc56
Bind processor 59 is bound with proc56

proc60 has 4 SMT threads.
Bind processor 60 is bound with proc60
Bind processor 61 is bound with proc60
Bind processor 62 is bound with proc60
Bind processor 63 is bound with proc60
可以看到,该系统具有SMT能力且当前SMT功能已启用。16个物理cpu对应着64个逻辑cpu。
      
2. bindprocessor
        # bindprocessor -q
        The available processors are:  0 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
      可以看到可用逻辑cpu个数是64个(0-63)。
3. prtconf
        # prtconf

System Model: IBM,8205-E6C
Machine Serial Number: ******
Processor Type: PowerPC_POWER7
Processor Implementation Mode: POWER 7
Processor Version: PV_7_Compat
Number Of Processors: 16
             ——16个物理cpu
Processor Clock Speed: 3550 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
LPAR Info: 1 02-8EE62
Memory Size: 31488 MB
Good Memory Size: 31488 MB
Platform Firmware level: AL740_126
Firmware Version: IBM,AL740_126
Console Login: enable
Auto Restart: true
Full Core: false
NX Crypto Acceleration: Not Capable
 
Network Information
        Host Name: autochinaebs
        IP Address: 192.168.1.123
        Sub Netmask: 255.255.255.0
        Gateway: 192.168.1.1
        Name Server: 192.168.1.221
        Domain Name: hand-china.com
 
Paging Space Information
        Total Paging Space: 32768MB
        Percent Used: 1%
 
Volume Groups Information
============================================================================== 
Active VGs
============================================================================== 
appvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk2            active            1999        38          00..00..00..00..38
============================================================================== 
 
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            558         412         111..41..37..111..112
hdisk1            active            558         418         111..47..37..111..112
============================================================================== 
 
INSTALLED RESOURCE LIST


The following resources are installed on the machine.
+/- = Added or deleted from Resource List.
*   = Diagnostic support not available.
        
  Model Architecture: chrp
  Model Implementation: Multiple Processor, PCI bus
        
+ sys0                                                              System Object
+ sysplanar0                                                        System Planar
* vio0                                                              Virtual I/O Bus
* vsa0             U8205.E6C.028EE62-V1-C0                          LPAR Virtual Serial Adapter
* vty0             U8205.E6C.028EE62-V1-C0-L0                       Asynchronous Terminal
* pci8             U78AA.001.WZSKF78-P1                             PCI Express Bus
+ fcs2             U78AA.001.WZSKF78-P1-C6-T1                       8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
* fcnet2           U78AA.001.WZSKF78-P1-C6-T1                       Fibre Channel Network Protocol Device
+ fscsi2           U78AA.001.WZSKF78-P1-C6-T1                       FC SCSI I/O Controller Protocol Device
* sfwcomm2         U78AA.001.WZSKF78-P1-C6-T1-W0-L0                 Fibre Channel Storage Framework Comm
+ fcs3             U78AA.001.WZSKF78-P1-C6-T2                       8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
* fcnet3           U78AA.001.WZSKF78-P1-C6-T2                       Fibre Channel Network Protocol Device
+ fscsi3           U78AA.001.WZSKF78-P1-C6-T2                       FC SCSI I/O Controller Protocol Device
* sfwcomm3         U78AA.001.WZSKF78-P1-C6-T2-W0-L0                 Fibre Channel Storage Framework Comm
* pci7             U78AA.001.WZSKF78-P1                             PCI Express Bus
* pci6             U78AA.001.WZSKF78-P1                             PCI Express Bus
+ fcs0             U78AA.001.WZSKF78-P1-C4-T1                       8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
* fcnet0           U78AA.001.WZSKF78-P1-C4-T1                       Fibre Channel Network Protocol Device
+ fscsi0           U78AA.001.WZSKF78-P1-C4-T1                       FC SCSI I/O Controller Protocol Device
* hdisk2           U78AA.001.WZSKF78-P1-C4-T1-W50050768030474FC-L0  MPIO IBM 2076 FC Disk
* sfwcomm0         U78AA.001.WZSKF78-P1-C4-T1-W0-L0                 Fibre Channel Storage Framework Comm
+ fcs1             U78AA.001.WZSKF78-P1-C4-T2                       8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
* fcnet1           U78AA.001.WZSKF78-P1-C4-T2                       Fibre Channel Network Protocol Device
+ fscsi1           U78AA.001.WZSKF78-P1-C4-T2                       FC SCSI I/O Controller Protocol Device
* sfwcomm1         U78AA.001.WZSKF78-P1-C4-T2-W0-L0                 Fibre Channel Storage Framework Comm
* pci5             U78AA.001.WZSKF78-P1                             PCI Express Bus
* pci4             U78AA.001.WZSKF78-P1                             PCI Express Bus
+ ent0             U78AA.001.WZSKF78-P1-C2-T1                       4-Port Gigabit Ethernet PCI-Express Adapter (e414571614102004)
+ ent1             U78AA.001.WZSKF78-P1-C2-T2                       4-Port Gigabit Ethernet PCI-Express Adapter (e414571614102004)
+ ent2             U78AA.001.WZSKF78-P1-C2-T3                       4-Port Gigabit Ethernet PCI-Express Adapter (e414571614102004)
+ ent3             U78AA.001.WZSKF78-P1-C2-T4                       4-Port Gigabit Ethernet PCI-Express Adapter (e414571614102004)
* pci3             U78AA.001.WZSKF78-P1                             PCI Express Bus
* pci2             U78AA.001.WZSKF78-P1                             PCI Express Bus
* pci1             U78AA.001.WZSKF78-P1                             PCI Express Bus
* pci9             U78AA.001.WZSKF78-P1                             PCI Bus
+ usbhc0           U78AA.001.WZSKF78-P1                             USB Host Controller (33103500)
+ usbhc1           U78AA.001.WZSKF78-P1                             USB Host Controller (33103500)
+ usbhc2           U78AA.001.WZSKF78-P1                             USB Enhanced Host Controller (3310e000)
* pci0             U78AA.001.WZSKF78-P1                             PCI Express Bus
+ sissas0          U78AA.001.WZSKF78-P1-T9                          PCIe x4 Planar 3Gb SAS Adapter
* sas0             U78AA.001.WZSKF78-P1-T9                          Controller SAS Protocol
* sfwcomm4                                                          SAS Storage Framework Comm
+ hdisk0           U78AA.001.WZSKF78-P2-D1                          SAS Disk Drive (300000 MB)
+ hdisk1           U78AA.001.WZSKF78-P2-D2                          SAS Disk Drive (300000 MB)
+ ses0             U78AA.001.WZSKF78-P2-Y1                          SAS Enclosure Services Device
+ ses1             U78AA.001.WZSKF78-P2-Y1                          SAS Enclosure Services Device
* sata0            U78AA.001.WZSKF78-P1-T9                          Controller SATA Protocol
* cd0              U78AA.001.WZSKF78-P2-D9                          SATA Optical Drive
+ L2cache0                                                          L2 Cache
+ mem0                                                              Memory
+ proc0                                                             Processor
+ proc4                                                             Processor
+ proc8                                                             Processor
+ proc12                                                            Processor
+ proc16                                                            Processor
+ proc20                                                            Processor
+ proc24                                                            Processor
+ proc28                                                            Processor
+ proc32                                                            Processor
+ proc36                                                            Processor
+ proc40                                                            Processor
+ proc44                                                            Processor
+ proc48                                                            Processor
+ proc52                                                            Processor
+ proc56                                                            Processor
+ proc60                                                            Processor


可以看到系统中有8个逻辑cpu。




查看cpu是几个核心的:

A:物理逻辑个数 A=pmcycles -m

B:CPU物理个数  B=prtconf|grep Processors

C:核数         C=A/B



相关文章
|
10月前
|
弹性计算 ice
阿里云4核8G云服务器配置价格:热门ECS实例及CPU处理器型号说明
阿里云2025年4核8G服务器配置价格汇总,涵盖经济型e实例、计算型c9i等热门ECS实例,CPU含Intel Xeon及AMD EPYC系列,月费159元起,年付低至1578元,按小时计费0.45元起,实际购买享折扣优惠。
3704 1
|
10月前
|
弹性计算 定位技术 数据中心
阿里云服务器配置选择方法:付费类型、地域及CPU内存配置全解析
阿里云服务器怎么选?2025最新指南:就近选择地域,降低延迟;长期使用选包年包月,短期灵活选按量付费;企业选2核4G5M仅199元/年,个人选2核2G3M低至99元/年,高性价比爆款推荐,轻松上云。
1104 11
|
10月前
|
弹性计算
阿里云ECS云服务器8核16G配置收费价格,多种ECS实例CPU及费用清单
阿里云8核16G云服务器价格因实例类型而异。计算型c9i约743元/月,一年6450元(7折);通用算力型u1仅673元/月,一年4225元(5.1折)。实际价格享时长折扣,详情见ECS官网。
|
11月前
|
存储 缓存 数据挖掘
阿里云轻量应用服务器“CPU优化型”配置介绍、费用价格说明
阿里云轻量应用服务器推出CPU优化型,提供更强计算性能,2核4GB起,最高16核64GB,全系支持200Mbps带宽。适用于企业级应用、数据库、游戏服务器等高算力场景,保障稳定高效运行。
1145 1
|
11月前
|
缓存 人工智能 算法
不同业务怎么选服务器?CPU / 内存 / 带宽配置表
本文详解了服务器三大核心配置——CPU、内存、带宽,帮助读者快速理解服务器性能原理。结合不同业务场景,如个人博客、电商、数据库、直播等,提供配置选择建议,并强调合理搭配的重要性,避免资源浪费或瓶颈限制。内容实用,适合初学者和业务选型参考。
1508 0
|
11月前
|
存储 消息中间件 缓存
从纳秒到毫秒的“时空之旅”:CPU是如何看待内存与硬盘的?
在数据爆炸的时代,如何高效存储与管理海量数据成为系统设计的核心挑战。本文从计算机存储体系结构出发,解析B+树、LSM树与Kafka日志结构在不同数据库中的应用与优化策略,帮助你深入理解高性能存储背后的原理。
348 0
|
存储
阿里云轻量应用服务器收费标准价格表:200Mbps带宽、CPU内存及存储配置详解
阿里云香港轻量应用服务器,200Mbps带宽,免备案,支持多IP及国际线路,月租25元起,年付享8.5折优惠,适用于网站、应用等多种场景。
3460 0
|
12月前
|
弹性计算 前端开发 NoSQL
2025最新阿里云服务器配置选择攻略:CPU、内存、带宽与系统盘全解析
本文详解2025年阿里云服务器ECS配置选择策略,涵盖CPU、内存、带宽与系统盘推荐,助你根据业务需求精准选型,提升性能与性价比。
|
存储 设计模式 监控
快速定位并优化CPU 与 JVM 内存性能瓶颈
本文介绍了 Java 应用常见的 CPU & JVM 内存热点原因及优化思路。
1420 166

热门文章

最新文章