1831151 Members
2796 Online
110020 Solutions
New Discussion

Re: performance

 
manu_5
Frequent Advisor

performance

Hi,
Is there any way to find what is the shmmax being used currently by the hp ux system.So that we can find if the /stand/system value is to be increased or not.There might be some os command to find shmmax real time usage
7 REPLIES 7
Eugeny Brychkov
Honored Contributor

Re: performance

Run SAM -> Kernel Configuration -> Configurable parameters -> and you'll see shmmax value
Eugeny
manu_5
Frequent Advisor

Re: performance

Hi,
I know how to see that using sam but that will be the one which has been tuned in /stand/system (SHMMAX) but i want to see what is currectly being utilized by system.
Arturo Perez del Galleg
Frequent Advisor

Re: performance

Hi, manu.
In the next script you will see the required value of parameter and others.
#!/usr/bin/ksh
# Script for getting several currently used values for configurable
# kernelparms (HP-UX 10.20)
# version 0.2
value=0

# Values for nproc, ninode, nfile (configured and real used)
oldIFS=$IFS
IFS=' /
'
sar -v 1 1| tail -1 | awk '{print $4" "$6" "$8}' |read nprocused nproc ninodeused ninode nfileused nfile
IFS=$oldIFS

# Values for semmni and msgmni (configured)
semmni="";msgmni=""
semmni=$(/usr/sbin/kmtune -q semmni | grep -v Parameter | grep -v "=========" | awk '{print $2}' | sed "s/NPROC/$nproc/" | sed 's/\*
/ \\* /' | sed 's/\-/ - /' | sed 's/(//' | sed 's/)//')
msgmni=$(/usr/sbin/kmtune -q msgmni | grep -v Parameter | grep -v "=========" | awk '{print $2}' | sed "s/NPROC/$nproc/" | sed 's/\*
/ \\* /' | sed 's/\-/ - /' | sed 's/(//' | sed 's/)//')
shmmni=$(/usr/sbin/kmtune -q shmmni | grep -v Parameter | grep -v "=========" | awk '{print $2}' | sed "s/NPROC/$nproc/" | sed 's/\*
/ \\* /' | sed 's/\-/ - /' | sed 's/(//' | sed 's/)//')
semmni=$(eval "expr $semmni")
msgmni=$(expr $msgmni)

# Values for semmni, shmmni and msgmni (real used)
# count the lines of ipcs, because Glance seems to do
let msgmniused=`ipcs -qa|grep "^q"| wc -l`
let shmmniused=`ipcs -mo|grep "^m"| wc -l`
let semmniused=`ipcs -sb|grep "^s"| wc -l`

# configured Values ...
for i in nflocks bufpages dbc_max_pct dbc_min_pct nbuf shmmni msgmni
do
echo "$i/D"| adb /stand/vmunix /dev/mem | grep '[0-9]' | read ${i}name ${i}value
done

if [ "$nflocksvalue" = "" ]; then
nflocksvalue=0
fi
nflocks="$nflocksvalue"
let bufpagesmb=$bufpagesvalue*4/1024

You have to do "echo" of the values.
HTH
Khalid A. Al-Tayaran
Valued Contributor

Re: performance


Hi,

Try the hpmem script found in the scripts thread...

attached for fast access...

Bill Hassell
Honored Contributor

Re: performance

shmmax is not the amount of shared memory in use. It is a fence (upper limit) that prevents a bad program from grabbing a very large amount of shared memory. What you are probably looking for are the sizes of all shared memory segments. Use:

ipcs -bmop

However, this is not the complete story. 32bit programs are severely limited as to the way they can use shared memory. There is a single shared memory map which *all* 32bit programs share, along with memory mapped files and shared libraries. This area is slightly less than 1000megs (or 1750 megs if the program is linked with SHARED_MAGIC) and will become badly fragmented as you start and stop various processes.

Thus, a program (like Oracle 32bit) may be able to request 500megs at startup but later in the week, if you restart the program, it will fail due to lack of memory. The only fix is to use memory windows (you'll need patches and spend time in the memory windows white paper).

64bit programs do not have any of these limits. If you want to see how fragmented shared memory had become, get a copy of shminfo from:

ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/


Bill Hassell, sysadmin
Sean OB_1
Honored Contributor

Re: performance

use the ipcs command to see what shared memory segments are allocated at any given time.

man ipcs

Sean
Oleg Zieaev_1
Regular Advisor

Re: performance

Hello.

I think the answer for your question is
ipcs -ma

If you think your shmmax limit is not high enough it can be queried
kmtune -l -q shmmax

We use ipcs -ma in our script to sum the corresponding field to get amout of shared memory in use.
In case you use memory windows - more work has to be done to finalize total amount of shared memory used. Also depends on which MAGIC you use while compiling your executables.
I believe there is a good white paper on HPdocs site for shared memory management, some of the details covered in the book "Performance tuning" by HP press.

Hope this helps,
0leg
Professionals will prevail ...