Operating System - HP-UX
1748110 Members
3868 Online
108758 Solutions
New Discussion юеВ

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

 
Jim Welch
Respected Contributor

How to get the current size of the dynamic buffer cache without using glance or measureware?

Anybody know how to get the current size of the dynamic buffer cache in hpux 10.20 or 11.0 without using glance, gpm, or measureware? (from a c program) Maybe using pstat? I've been reading through the pstat.h file (/usr/include/sys/pstat.h), but nothing obvious jumps out at me...maybe you have to calculate it by starting with total physical memory (psd_rm?) - system memory (psv_sysmem?).... or maybe it's there but I just don't recognize it...
Any sufficiently advanced technology is indistinguishable from Magic - Arthur C. Clarke
8 REPLIES 8
Alan Riggs
Honored Contributor

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

You can probably retrieve it by running adb against /dev/kmem, but I am afraid I do not not how to dig the buffer cache out. Any adb gurus out there?
James R. Ferguson
Acclaimed Contributor

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

Jim:

Try /usr/sbin/sysdef. See man 1m sysdef.

...JRF...
Alan Riggs
Honored Contributor

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

I may be incorrect, but I do not believe sysdef will accurately report the shifting values of bufpages for a system running dynamic buffer caching.

Jim Welch
Respected Contributor

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

I agree. sysdef will give you the values of dbc_min_pct and dbc_max_pct, not the current size or number of pages in use by the buffer cache.
Any sufficiently advanced technology is indistinguishable from Magic - Arthur C. Clarke
James R. Ferguson
Acclaimed Contributor

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

Jim & Alan:

Sorry, yes, you are correct. My answer would provide the static values (floor and ceiling) but NOT the dynamic values as you asked. I don't know how to see the changes other than via Glance (which you specifically excluded in the original query!).

...JRF...
CHRIS ANORUO
Honored Contributor

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

Hi Jim,

Use the line command:
echo "bufpages/D" | adb /stand/vmunix /dev/mem.

Cheers!

When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
John Palmer
Honored Contributor

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

Chris's description for obtaining bufpages from the running kernel is correct.

The value returned is the number of 4Kb pages currently in the buffer cache.
Jim Welch
Respected Contributor

Re: How to get the current size of the dynamic buffer cache without using glance or measureware?

Thanks Chris, that's the closest answer so far. I was hoping to figure out how to get the info from pstat. I think I'll continue to play with pstat in my spare time and see what I can get out of it....
Any sufficiently advanced technology is indistinguishable from Magic - Arthur C. Clarke