Operating System - HP-UX
1753900 Members
7765 Online
108809 Solutions
New Discussion юеВ

How to get the current size of the system buffer cache?

 
SOLVED
Go to solution
zenith37
Occasional Advisor

How to get the current size of the system buffer cache?

I have been crawling around the internet for a few days now looking for this piece of information. I have found many documents on memory tuning and system administration that talk of working with dbc_min and dbc_max in order to specify boundaries for the system buffer cache. What I have not found is how to query the actually current size. I am looking to do this programmatically either through system calls or a utility that should be on all UX boxes I come across (i.e. I cannot put a tool there myself for every box).

I have found a structure called "minfo" in the sysinfo.h (/usr/include/sys/sysinfo.h). It has a member called cache, which has the number of pages currently in cache. Though I cannot seem to find any documentation on a function I can call to populate the structure.
10 REPLIES 10

Re: How to get the current size of the system buffer cache?

Do you have glance on your system?

glance -m

will show this information

HTH

Duncan

I am an HPE Employee
Accept or Kudo
zenith37
Occasional Advisor

Re: How to get the current size of the system buffer cache?

Unfortunately I do not believe I can rely on it being present. This is going to be on several ux systems in which the administration is out of my control. I am more after the system calls that tools such as glance use to pull that information.
Jose Mosquera
Honored Contributor

Re: How to get the current size of the system buffer cache?

Hi,

These are Kernel tuneable values, then you can check these values with the comand "kctune", please review carefully command options:
#man kctune

Also recomend you review this HP-UX Performance Cookbook at the Kernel Tunables section:
http://h21007.www2.hp.com/portal/download/files/unprot/devresource/docs/techpapers/uxperfcookbook.pdf

Rgds.
zenith37
Occasional Advisor

Re: How to get the current size of the system buffer cache?

Jose, I am not looking for the value of the parameters, I am looking for how much is currently being used at the time of polling. This value should be dynamic in many cases and something that would not be explicitly set in the tunables.
Kannandgl_1
Frequent Advisor

Re: How to get the current size of the system buffer cache?

Dear zenith37 ,

suppose u have HP getsysinfo scripts .. run the script and send it me log file ...

regards
rajamani...

Zinky
Honored Contributor

Re: How to get the current size of the system buffer cache?

If you want to write you own C Prog, I think you are on the right track in structure "minfo".

I have a memstat.c program that also use the same header and struct.

Generally though -- if your UX system has been up for a godd number of hours, your system buffer cache will always equate to dbc_max_pct or nbuf.

Hakuna Matata

Favourite Toy:
AMD Athlon II X6 1090T 6-core, 16GB RAM, 12TB ZFS RAIDZ-2 Storage. Linux Centos 5.6 running KVM Hypervisor. Virtual Machines: Ubuntu, Mint, Solaris 10, Windows 7 Professional, Windows XP Pro, Windows Server 2008R2, DOS 6.22, OpenFiler
zenith37
Occasional Advisor

Re: How to get the current size of the system buffer cache?

Alzhy:

You say you have a C program that uses that struct? What function do you call to populate it? That seems to be the piece I am missing.
Mike Crawley
New Member
Solution

Re: How to get the current size of the system buffer cache?

If you have 11.31 you can us the below command.


>kcusage filecache_max
Tunable Usage / Setting
=============================================
filecache_max 60939350016 / 65330475008


This shows how much filecache i am using.
zenith37
Occasional Advisor

Re: How to get the current size of the system buffer cache?

Well, I just had my <11.31 requirement removed. Aftering looking through headers files for 31 instead of 23 I found the following:

struct pst_vminfo.psv_filecache_size

In /usr/include/sys/pstat/vm_pstat_body.h

This value matches that provided by kcusage -filesystem_max and appears to be exactly what I need. Thanks to all who weighed in.