2023-07-06 16:28:22 來源:個(gè)人圖書館-xfxyxh
(資料圖片僅供參考)
There are many times when one has to check CPU details of the server which are like the number of cores, sockets, etc. This detail is useful in capacity planning, troubleshooting, performance analysis, etc. There are many ways to get these details as below –
ioscan
commandcstm toolprint_manifest
reportmachinfo
commandMP consoletop
commandSAR outputBefore going into these methods make sure you check if logical CPUs are enabled on server or not.If yes then you need to take that into consideration while calculating the number of CPUs.
Let’s see the above methods one by one.
ioscan commandThis is a well-known command to every HPUX server administrator. To scan or list hardware on the system, we use this command. Filtering processors out of this command give you details about CPU. This is helpful to get the only number of processors on the system
[server12] MP:CM> ss SS System Processor Status: Monarch Processor: 0 Processor Module 0: Installed and Configured Processor Module 1: Installed and Configured Processor Module 2: Installed and Configured Processor Module 3: Installed and Configured |
This is the simplest way to check the number of CPU on HPUX as well as any Linux system. The top output shows your list of the processor at top of the page.
# top System: server1 Fri Nov 25 14:29:06 2016 Load averages: 0.15, 0.11, 0.11 386 processes: 362 sleeping, 24 running Cpu states: CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS 0 0.13 23.8% 0.0% 0.0% 76.2% 0.0% 0.0% 0.0% 0.0% 1 0.18 25.7% 0.0% 7.9% 66.3% 0.0% 0.0% 0.0% 0.0% 2 0.16 14.9% 0.0% 2.0% 83.2% 0.0% 0.0% 0.0% 0.0% 3 0.13 3.0% 0.0% 5.0% 92.1% 0.0% 0.0% 0.0% 0.0% 4 0.13 23.8% 0.0% 4.0% 72.3% 0.0% 0.0% 0.0% 0.0% 5 0.15 17.8% 0.0% 4.0% 78.2% 0.0% 0.0% 0.0% 0.0% 6 0.15 11.9% 0.0% 4.0% 84.2% 0.0% 0.0% 0.0% 0.0% 7 0.16 20.8% 0.0% 5.0% 74.3% 0.0% 0.0% 0.0% 0.0% --- ---- ----- ----- ----- ----- ----- ----- ----- ----- avg 0.15 17.8% 0.0% 4.0% 78.2% 0.0% 0.0% 0.0% 0.0% |
You can see CPU is numbered from 0 to 8 i.e. total of 8 CPU active.
sar outputEven sar output can be used to determine the number of CPU in the system. Use just one iteration for output for one second. sar will show one row for each cpu value.
Read our SAR tutorialsSAR: All you need to knowSAR: CPU & Memory reportingSAR: Disk & Network reportingCounting the number of rows can help us figure out CPU count.
# sar -Mu 1 1 HP-UX apcrss78 B.11.11 U 9000 /800 11 /25/16 14:41:14 cpu %usr %sys %wio %idle 14:41:15 0 0 0 0 99 1 0 1 0 98 2 0 0 0 99 3 0 0 0 99 4 0 0 0 99 5 0 0 0 99 6 24 1 0 75 7 0 1 0 98 system 3 1 0 96 # sar -Mu 1 1 | awk "END {print NR-5}" 8 |
See first command actual output. We are stripping off extra 5 lines which are for total, headers to get exact count using awk. in second command. Even first output shows CPU numbering like top in first column!
關(guān)鍵詞: