天天看點

AIX 檢視伺服器CPU個數

系統中有很多指令可以檢視cpu的個數,但是哪個指令輸出的是邏輯cpu個數,哪個又是實體cpu個數呢?

      從AIX5.3起,系統引入了SMT(Simultaneous multi-threading:同步多線程)的功能,其允許兩個處理線程在同一顆處理器上運作,對作業系統而言,一顆實體處理器邏輯上會成為兩個處理單元(邏輯處理器)。也就是說,在SMT功能啟用的情況下,邏輯cpu個數是實體cpu個數的兩倍,而在SMT功能禁用的情況下,邏輯cpu個數與實體cpu個數相等。

      下面我們介紹如何通過各種指令檢查系統中的實體cpu和邏輯cpu的個數。

1. smtctl

        # smtctl 

可以看到,該系統具有SMT能力且目前SMT功能已啟用。16個實體cpu對應着64個邏輯cpu。

2. bindprocessor

        # bindprocessor -q

      可以看到可用邏輯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:

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