Re: How to get the current size of the dynamic buffer cache without using glance or measureware? (290 Views)
Reply
Respected Contributor
Jim Welch
Posts: 201
Registered: ‎05-04-2000
Message 1 of 9 (290 Views)

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
Honored Contributor
Alan Riggs
Posts: 881
Registered: ‎03-08-1998
Message 2 of 9 (290 Views)

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?
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 3 of 9 (290 Views)

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...
Honored Contributor
Alan Riggs
Posts: 881
Registered: ‎03-08-1998
Message 4 of 9 (290 Views)

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.

Respected Contributor
Jim Welch
Posts: 201
Registered: ‎05-04-2000
Message 5 of 9 (290 Views)

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
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 6 of 9 (290 Views)

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...
Honored Contributor
CHRIS ANORUO
Posts: 1,361
Registered: ‎05-29-1998
Message 7 of 9 (290 Views)

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.
Honored Contributor
John Palmer
Posts: 1,842
Registered: ‎07-28-1997
Message 8 of 9 (290 Views)

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.
Respected Contributor
Jim Welch
Posts: 201
Registered: ‎05-04-2000
Message 9 of 9 (290 Views)

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
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.