Operating System - HP-UX
1829148 Members
2715 Online
109986 Solutions
New Discussion

Re: collecting kernel metrics (semaphores and shared mem)

 
Larry Schauer
Occasional Advisor

collecting kernel metrics (semaphores and shared mem)

I read a couple of other messages regarding similiar problems, but they didn't quite address my situation. We're running HP-UX 11.0, and I need a way to collect the following parameters (current values):

semmns
semmni
shmseg
shmmni
semmap
semmnu

I looked at sar and vmstat; neither have this data. glance has semmni and shmmni, but not the others. We don't have perfview on these systems. We're having problems with a certain s/w product, and the vendor wants us to increase all these parameters. I'd like to ensure that they actually need increasing before doing something like this. Solaris has a 'kstat' command. Does HP have anything similiar?

Thanks in advance,
Larry Schauer
Packet is GOOD, TTAs are BAD
11 REPLIES 11
hari jayaram_1
Frequent Advisor

Re: collecting kernel metrics (semaphores and shared mem)

Larry

You can get values of most of these parameters from /stand/system.

Regards

Hari Jayaram
Larry Schauer
Occasional Advisor

Re: collecting kernel metrics (semaphores and shared mem)

Hari,
Thanks for the quick response, but /stand/system doesn't give the info I need. I need to know the current utilization of those parameters.

Thanks,
Larry
Packet is GOOD, TTAs are BAD
hari jayaram_1
Frequent Advisor

Re: collecting kernel metrics (semaphores and shared mem)

Larry

Sorry about that. However I learnt a new command from you for sun. It is only on 5.8 and not below that.
If you have glance the system tables should give you the following information which is current
Proc Table (nproc) 4116 129 3 3
File Table (nfile) 30010 515 2 2
Shared Mem Table (shmmni) 500 9 2 2
Message Table (msgmni) 2048 2 0 0
Semaphore Table (semmni) 4096 25 1 1
File Locks (nflocks) 4096 7 0 0
Pseudo Terminals (npty) 60 0 0 0
Buffer Headers (nbuf) na 88842 na na

Let me look around a bit and see if I can get some more inf
Sukant Naik
Trusted Contributor

Re: collecting kernel metrics (semaphores and shared mem)

Hi Larry,

I dont know whether I have understood the question properly.

If you are looking for the values of the kernel parameters being set then you can use command 'kmtune'

# kmtune -l > /kmtune.log

So the file contains all the values of the kernel parameters being set.

Hope this helps you.

- Sukant
Who dares he wins
kish_1
Valued Contributor

Re: collecting kernel metrics (semaphores and shared mem)

try using the /usr/sbin/sam or
/usr/sbin/kmtune -l > kernel.parms
share the power of the knowledge
Larry Schauer
Occasional Advisor

Re: collecting kernel metrics (semaphores and shared mem)

Thanks to everyone for responding.

Sukant and Babu---the kmtune command doesn't answer my question, but I need that information (max values) anyway, so thanks.

Hari--yes, that's the info I'm looking for. The glance snapshot shows the values for 2 of the parameters. Now if we can find a way to obtain the other parameters.

Thanks,
Larry
Packet is GOOD, TTAs are BAD
Jeff Schussele
Honored Contributor

Re: collecting kernel metrics (semaphores and shared mem)

Hi Larry,

I don't see any way to get these directly w/o writing something to use pstat calls.
Specifically pstat_getsem & pstat_getshm.

Note these are the type of calls Glance uses.

See the following for info on usage:

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90682/B2355-90682_top.html&con=/hpux/onlinedocs/B2355-90682/00/01/137-con.html&toc=/hpux/onlinedocs/B2355-90682/00/01/137-toc.html&searchterms=pstat&queryid=20020425-074747

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
pap
Respected Contributor

Re: collecting kernel metrics (semaphores and shared mem)

Hi,
You can achive that in a file in two ways.

1.
#kmtune >test.txt

2.

sysdef >test1.txt

once you open the file you will find all kernel parameters in it with current value set on each.
"Winners don't do different things , they do things differently"
Mladen Despic
Honored Contributor

Re: collecting kernel metrics (semaphores and shared mem)

Hi Larry,

You can monitor current usage
of such resources via 'ipcs'
command. The man pages for
'ipcs' explain the meaning of
various columns in the output.
Use 'ipcs -a' to display all
columns.

On the other hand, the default
settings for the parameters:
semmns, semmap, and semmnu are
determined by formulas.
You can see this from the
output of 'kmtune':

semmap (SEMMNI+2)
semmns (SEMMNI*2)
semmnu (SEMMNI/2).

So, unless you have a reason
to change the defaults, you
just need to modify the value
for semmni, and the other
three "semaphore parameters"
will adjust automatically.

If you need to do customized
settings, it would be quite
important, I think, to
understand the meaning of
each resource. Again, the
man pages for 'ipcs' might
be helpful.

For example, the parameter
shmseg sets the maximum number
of shared memory segments per
process. If you run
'ipcs -mopb' you might be able
to determine if the number
of shared memory segments
for any process is even close
to the current shmseg setting.

I also like to use the
attached glance syntax to get
more information. If you want
to try it, save it to your
current directory as shmem.txt
and then run:

glance -adviser_only -syntax shmem.txt -iterations
Frank Slootweg
Honored Contributor

Re: collecting kernel metrics (semaphores and shared mem)

Please see SAM's Help for these parameters. I.e. select a parameter and then press "Help".

I think your main problem comes from not fully understanding which parameter means what.

Some specific comments:

semmap gives a *warning* if not properly dimensioned, see the Help.

semmns can be the same as semmni, unless semaphore sets (sets of semaphores) are used, which is hardly ever the case.

semmni usage is shown by ipcs(1).

semmnu hardly ever used, but if you want to be sure, set it to semmni/semmns.

shmseg this is a *limit*, you can see the sizes of Shared Memory segments with ipcs(1), so you can see if actual usage is approaching this limit.

shmmni usage is shown by ipcs(1).


Bryce Nutter
New Member

Re: collecting kernel metrics (semaphores and shared mem)

Larry,

I'm in the same boat as you were 2 years ago and would like to know when I am approaching the point(within 10%) where I need to retune. I'm writing a home-grown script in Patrol to alert when within 10% of certain semaphore and shared memory maximums. What it boils down to is what maximums are output of kmtune that can be seen approaching in ipcs?