Operating System - HP-UX
1833016 Members
2301 Online
110048 Solutions
New Discussion

Re: find number of cpus in server

 
SOLVED
Go to solution
Nyck_1
Super Advisor

find number of cpus in server

what command do I run/need to find the number of CPUs on a given server. It would be nice to be able to run a "sysinfo" type of command to get lots of systen info.
9 REPLIES 9
Pete Randall
Outstanding Contributor
Solution

Re: find number of cpus in server

ioscan -k |grep -n processor |wc -l


Pete

Pete
MarkSyder
Honored Contributor

Re: find number of cpus in server

sam -> performance monitors -> system properties.

Or xstm

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Sanjay_6
Honored Contributor

Re: find number of cpus in server

Hi,

ioscan -fn will give you a lot of info. primary what is there on your system.

ioscan -fn |grep -i processor

will give you all the processors on your system.

ioscan -fn |grep -i processor |wc -l

will give you the count of proccessor.

Also look into cstm (part of support tool manager) which gets you more detailed info.

For eg. for cpu info.

echo 'selclass qualifier cpu;info;wait;infolog' |cstm > /tmp/cpuinfo.txt

more /tmp/cpuinfo.txt

Hope this helps.

Regds
Robert-Jan Goossens
Honored Contributor

Re: find number of cpus in server

Hi,

The cstm command Sanjay gave you is very good, if you have Ignite installed you could also use the print_manifest command.

Regards,
Robert-Jan
bhavin asokan
Honored Contributor

Re: find number of cpus in server

hi,

if you want only to know how many cpu are there on server , use the top command.
it will show the cpu's ,per cpu usage,etc.

regds,
Muthukumar_5
Honored Contributor

Re: find number of cpus in server

IF you are having print_manifest or cstm then it will give system informations.

Using sam --> performance monitor --> system properties will give more informations.

To use sysinfo then get the sysinfo script from here and get.
http://unix.derkeiler.com/Mailing-Lists/HP-UX-Admin/2004-11/0056.html

hth.
Easy to suggest when don't know about the problem!
Geoff Wild
Honored Contributor

Re: find number of cpus in server

Or use this handy dandy script called hpmem:

#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
adb $hpux /dev/kmem | \
tr "\012" " " | \
read junk junk2 kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
GetKernelSymbol "processor_count"
print CPU Count: $kval
GetKernelSymbol "itick_per_tick"
let speed=kval/10000
print CPU Speed: $speed MHz
if ((rev > 10)); then
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
else
GetKernelSymbol "physmem"
fi
let mb=kval*4/1024 # convert pages to MB
print RAM Size: $mb MB
GetKernelSymbol "bufpages"
let mb=kval*4/1024 # convert pages to MB
print bufpages: $mb MB
GetKernelSymbol "maxuprc"
print maxuprc: $kval
GetKernelSymbol "maxvgs"
print maxvgs: $kval
GetKernelSymbol "maxfiles"
print maxfiles: $kval
GetKernelSymbol "max_thread_proc"
print max_thread_proc: $kval
GetKernelSymbol "nfile"
print nfile: $kval
GetKernelSymbol "nflocks"
print nflock: $kval
GetKernelSymbol "nproc"
print nproc: $kval
GetKernelSymbol "ninode"
print ninode: $kval
GetKernelSymbol "vfd_cw"
print shmmax: $kval
GetKernelSymbol "shmmni"
print shmmni: $kval
GetKernelSymbol "dbc_max_pct"
print dbc_max_pct: $kval



Output like:

# hpmem
HP-UX sha1 B.11.11 U 9000/785 2012953216 unlimited-user license
CPU Count: 1
CPU Speed: 400 MHz
CPU HW Support: 64-bit
Kernel Support: 64-bit
RAM Size: 768 MB
bufpages: 192 MB
maxuprc: 200
maxvgs: 10
maxfiles: 60
max_thread_proc: 64
nfile: 8202
nflock: 800
nproc: 2048
ninode: 2248
shmmax: 1073741824
shmmni: 200
dbc_max_pct: 25


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Biswajit Tripathy
Honored Contributor

Re: find number of cpus in server

One addition to all the great suggestions above.

If you are on an IA box (on 11.23), HP provides
a "machinfo" command that prints out the # of
CPUs and clock speed, details of processor arch and
vendor, formwire and platform info, memory and
OS info etc. Almost everyting you needed to know
at one place.

- Biswajit
:-)
HGN
Honored Contributor

Re: find number of cpus in server

Hi

You can use the command
#ioscan -k |grep -i processor |wc -l

or you can also use cstm
cstm>map
cstm>sel dev xx(the cpu device number)
cstm>info
-- Updating Map --
Updating Map...
cstm>il
you can look for the cpu map there

Rgds

HGN