Operating System - HP-UX
1832994 Members
2788 Online
110048 Solutions
New Discussion

how to find CPU count, speed and

 
Salm
Frequent Advisor

how to find CPU count, speed and

I have HP-UX Model rp7420.running HPUX 11.11
I need to know how would find cpu processor count and speed ?

Thanks in advance
5 REPLIES 5
Robert-Jan Goossens
Honored Contributor

Re: how to find CPU count, speed and

Hi,

have a look at these faqs.

http://mirrors.develooper.com/hpux/faq.html

Robert-Jan
Steven E. Protter
Exalted Contributor

Re: how to find CPU count, speed and

Shalom,

Used to be, top would show you physical CPUS.

However with dual core that count can get messed up.

mstm/cstm/xstm are valid tools for getting physical CPU counts.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tim Nelson
Honored Contributor

Re: how to find CPU count, speed and

PROC_SPEED=`echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem |awk -F: 'NR>1 {print $2}'`

NU_PROC=`echo "runningprocs/D" | adb -k /stand/vmunix /dev/kmem |awk -F: 'NR>1 {print $2}'`
Sandman!
Honored Contributor

Re: how to find CPU count, speed and

IMHO the best way to get that information is via SAM.

SAM -> Performance Monitors -> System Properties -> Processor
Geoff Wild
Honored Contributor

Re: how to find CPU count, speed and

Or this script:

# cat /usr/local/bin/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" " " | \
awk -F: '{print $3}'|\
read kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
# if 11iv2 or higher - get cpu this way
ver=$(uname -r | cut -d. -f3)
if ((ver > 22)); then
kval=`echo "processor_count/D" | adb /stand/vmunix /dev/kmem |tail -1|awk -F: '{print $2}' `
else
GetKernelSymbol "processor_count"
fi
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
# if 11iv2 or higher - get memory this way
ver=$(uname -r | cut -d. -f3)
if ((ver > 22)); then
kernel=$(/usr/sbin/kcpath -x)
hexval=$(echo "phys_mem_pages/A" | adb $kernel /dev/kmem|tail +2|awk '{print $2}')
REAL_MEM=$(echo ${hexval}=D|adb)
mb=$(expr ${REAL_MEM} / 256)
else
let mb=kval*4/1024 # convert pages to MB
fi
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 "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 pc1010 B.11.23 U 9000/800 79567351 unlimited-user license
CPU Count: 4
CPU Speed: 999 MHz
CPU HW Support: 64-bit
Kernel Support: 64-bit
RAM Size: 40958 MB
bufpages: 1638 MB
maxuprc: 3780
maxvgs: 255
maxfiles: 2048
max_thread_proc:
nfile: 65536
nproc: 4200
ninode: 35648
shmmax: 1073741824
shmmni: 512
dbc_max_pct: 4


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.